Point2D() public method

public Point2D ( System.Drawing.CGPoint pt ) : Point
pt System.Drawing.CGPoint
return System.Drawing.Point
Ejemplo n.º 1
0
        public void AddAreas(Graphics g, ChartStyle cs, int nSeries, int nPoints)
        {
            float[]  ySum = new float[nPoints];
            PointF[] pts  = new PointF[2 * nPoints];
            PointF[] pt0  = new PointF[nPoints];
            PointF[] pt1  = new PointF[nPoints];
            for (int i = 0; i < nPoints; i++)
            {
                ySum [i] = AreaAxis;
            }

            int n = 0;

            foreach (DataSeries ds in DataSeriesList)
            {
                Pen aPen = new Pen(ds.LineStyle.LineColor, ds.LineStyle.Thickness);
                aPen.DashStyle = ds.LineStyle.Pattern;
                Color fillColor = Color.FromArgb(CMap [n, 0], CMap [n, 1],
                                                 CMap [n, 2], CMap [n, 3]);
                SolidBrush aBrush = new SolidBrush(fillColor);

                // Draw lines and areas:
                if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Lines)
                {
                    for (int i = 0; i < nPoints; i++)
                    {
                        pt0 [i]  = new PointF(((PointF)ds.PointList [i]).X, ySum [i]);
                        ySum [i] = ySum [i] + ((PointF)ds.PointList [i]).Y;
                        pt1 [i]  = new PointF(((PointF)ds.PointList [i]).X, ySum [i]);
                        pts [i]  = cs.Point2D(pt0 [i]);
                        pts [2 * nPoints - 1 - i] = cs.Point2D(pt1 [i]);
                    }
                    g.FillPolygon(aBrush, pts);
                    g.DrawPolygon(Pens.Black, pts);
                }
                n++;
            }
        }
        public void AddAreas(Graphics g, ChartStyle cs, int nSeries, int nPoints)
        {
            float[] ySum = new float[nPoints];
            PointF[] pts = new PointF[2 * nPoints];
            PointF[] pt0 = new PointF[nPoints];
            PointF[] pt1 = new PointF[nPoints];
            for (int i = 0; i < nPoints; i++) {
                ySum [i] = AreaAxis;
            }

            int n = 0;
            foreach (DataSeries ds in DataSeriesList) {
                Pen aPen = new Pen (ds.LineStyle.LineColor, ds.LineStyle.Thickness);
                aPen.DashStyle = ds.LineStyle.Pattern;
                Color fillColor = Color.FromArgb (CMap [n, 0], CMap [n, 1],
                    CMap [n, 2], CMap [n, 3]);
                SolidBrush aBrush = new SolidBrush (fillColor);

                // Draw lines and areas:
                if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Lines) {
                    for (int i = 0; i < nPoints; i++) {
                        pt0 [i] = new PointF (((PointF)ds.PointList [i]).X, ySum [i]);
                        ySum [i] = ySum [i] + ((PointF)ds.PointList [i]).Y;
                        pt1 [i] = new PointF (((PointF)ds.PointList [i]).X, ySum [i]);
                        pts [i] = cs.Point2D (pt0 [i]);
                        pts [2 * nPoints - 1 - i] = cs.Point2D (pt1 [i]);
                    }
                    g.FillPolygon (aBrush, pts);
                    g.DrawPolygon (Pens.Black, pts);
                }
                n++;
            }
        }