public Point2DY2 ( System.Drawing.CGPoint pt ) : |
||
pt | System.Drawing.CGPoint | |
return |
public void AddLines(Graphics g, ChartStyle cs) { // Plot lines: foreach (DataSeries ds in DataSeriesList) { if (ds.LineStyle.IsVisible == true) { var aPen = new Pen (ds.LineStyle.LineColor, ds.LineStyle.Thickness); aPen.DashStyle = ds.LineStyle.Pattern; if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Lines) { for (int i = 1; i < ds.PointList.Count; i++) { if (!ds.IsY2Data) { g.DrawLine (aPen, cs.Point2D ((CGPoint)ds.PointList[i - 1]), cs.Point2D ((CGPoint)ds.PointList[i])); } else { g.DrawLine (aPen, cs.Point2DY2 ((CGPoint)ds.PointList[i - 1]), cs.Point2DY2 ((CGPoint)ds.PointList[i])); } } } else if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Splines) { var al = new ArrayList (); for (int i = 0; i < ds.PointList.Count; i++) { var pt = (CGPoint)ds.PointList[i]; if (!ds.IsY2Data) { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.YLimMin && pt.Y <= cs.YLimMax) al.Add (pt); } else { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.Y2LimMin && pt.Y <= cs.Y2LimMax) al.Add (pt); } } var pts = new Point[al.Count]; for (int i = 0; i < pts.Length; i++) { if (!ds.IsY2Data) { pts[i] = cs.Point2D ((CGPoint)(al[i])); } else { pts[i] = cs.Point2DY2 ((CGPoint)(al[i])); } } g.DrawCurve (aPen, pts); } aPen.Dispose (); } } // Plot Symbols: foreach (DataSeries ds in DataSeriesList) { for (int i = 0; i < ds.PointList.Count; i++) { var pt = (CGPoint)ds.PointList[i]; if (!ds.IsY2Data) { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.YLimMin && pt.Y <= cs.YLimMax) ds.SymbolStyle.DrawSymbol (g, cs.Point2D ((CGPoint)ds.PointList[i])); } else { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.Y2LimMin && pt.Y <= cs.Y2LimMax) ds.SymbolStyle.DrawSymbol (g, cs.Point2DY2 ((CGPoint)ds.PointList[i])); } } } }
public void AddLines(Graphics g, ChartStyle cs) { // Plot lines: foreach (DataSeries ds in DataSeriesList) { if (ds.LineStyle.IsVisible == true) { var aPen = new Pen(ds.LineStyle.LineColor, ds.LineStyle.Thickness); aPen.DashStyle = ds.LineStyle.Pattern; if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Lines) { for (int i = 1; i < ds.PointList.Count; i++) { if (!ds.IsY2Data) { g.DrawLine(aPen, cs.Point2D((CGPoint)ds.PointList[i - 1]), cs.Point2D((CGPoint)ds.PointList[i])); } else { g.DrawLine(aPen, cs.Point2DY2((CGPoint)ds.PointList[i - 1]), cs.Point2DY2((CGPoint)ds.PointList[i])); } } } else if (ds.LineStyle.PlotMethod == LineStyle.PlotLinesMethodEnum.Splines) { var al = new ArrayList(); for (int i = 0; i < ds.PointList.Count; i++) { var pt = (CGPoint)ds.PointList[i]; if (!ds.IsY2Data) { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.YLimMin && pt.Y <= cs.YLimMax) { al.Add(pt); } } else { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.Y2LimMin && pt.Y <= cs.Y2LimMax) { al.Add(pt); } } } var pts = new Point[al.Count]; for (int i = 0; i < pts.Length; i++) { if (!ds.IsY2Data) { pts[i] = cs.Point2D((CGPoint)(al[i])); } else { pts[i] = cs.Point2DY2((CGPoint)(al[i])); } } g.DrawCurve(aPen, pts); } aPen.Dispose(); } } // Plot Symbols: foreach (DataSeries ds in DataSeriesList) { for (int i = 0; i < ds.PointList.Count; i++) { var pt = (CGPoint)ds.PointList[i]; if (!ds.IsY2Data) { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.YLimMin && pt.Y <= cs.YLimMax) { ds.SymbolStyle.DrawSymbol(g, cs.Point2D((CGPoint)ds.PointList[i])); } } else { if (pt.X >= cs.XLimMin && pt.X <= cs.XLimMax && pt.Y >= cs.Y2LimMin && pt.Y <= cs.Y2LimMax) { ds.SymbolStyle.DrawSymbol(g, cs.Point2DY2((CGPoint)ds.PointList[i])); } } } } }