public Point2D ( System.Drawing.CGPoint pt ) : |
||
pt | System.Drawing.CGPoint | |
return |
public PointF Point2D(CGPoint pt)
{
var aPoint = new PointF ();
if (pt.X < XLimMin || pt.X > XLimMax || pt.Y < YLimMin || pt.Y > YLimMax) {
pt.X = float.NaN;
pt.Y = float.NaN;
}
aPoint.X = (float)(PlotArea.X + (pt.X - XLimMin) * PlotArea.Width / (XLimMax - XLimMin));
aPoint.Y = (float)(PlotArea.Bottom - (pt.Y - YLimMin) * PlotArea.Height / (YLimMax - YLimMin));
return aPoint;
}
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; for (int i = 1; i < ds.PointList.Count; i++) g.DrawLine(aPen, cs.Point2D ((CGPoint)ds.PointList[i - 1]), cs.Point2D ((CGPoint)ds.PointList[i])); aPen.Dispose(); } } }