MTExample4_8.ChartStyle.SetPolarArea C# (CSharp) 메소드

SetPolarArea() 공개 메소드

public SetPolarArea ( ) : CGRect
리턴 CGRect
        public CGRect SetPolarArea()
        {
            Offset = form1.PlotPanel.Width / 10;
            int height = 0;
            if (form1.PlotPanel.Height < form1.PlotPanel.Width)
                height = form1.PlotPanel.Height - 2 * Offset;
            else
                height = form1.PlotPanel.Height - 7 * Offset;
            int width = height;
            var rect = new CGRect (Offset, Offset, width, height);
            return rect;
        }

Usage Example

예제 #1
0
        public void AddLegend(Graphics g, DataCollection dc, ChartStyle cs)
        {
            if (dc.DataSeriesList.Count < 1)
            {
                return;
            }


            if (!IsLegendVisible)
            {
                return;
            }

            int numberOfDataSeries = dc.DataSeriesList.Count;

            string[] legendLabels = new string[dc.DataSeriesList.Count];
            int      n            = 0;

            foreach (DataSeries ds in dc.DataSeriesList)
            {
                legendLabels [n] = ds.SeriesName;
                n++;
            }
            //float offSet = 10;
            float  xc          = 0f;
            float  yc          = 0f;
            CGSize size        = g.MeasureString(legendLabels [0], LegendFont);
            var    legendWidth = (float)size.Width;

            for (int i = 0; i < legendLabels.Length; i++)
            {
                size = g.MeasureString(legendLabels [i], LegendFont);
                var tempWidth = (float)size.Width;
                if (legendWidth < tempWidth)
                {
                    legendWidth = tempWidth;
                }
            }
            legendWidth = legendWidth + 50.0f;
            float hWidth       = legendWidth / 2;
            float legendHeight = 18.0f * numberOfDataSeries;
            float hHeight      = legendHeight / 2;

            CGRect rect = cs.SetPolarArea();

            xc = (float)(rect.X + rect.Width + cs.Offset + 15 + hWidth / 2);
            yc = (float)(rect.Y + rect.Height / 2);

            DrawLegend(g, xc, yc, hWidth, hHeight, dc, cs);
        }
All Usage Examples Of MTExample4_8.ChartStyle::SetPolarArea