public Point2D ( |
||
pt | ||
리턴 |
public PointF Point2D(PointF pt)
{
PointF aPoint = new PointF ();
if (pt.X < XLimMin || pt.X > XLimMax ||
pt.Y < YLimMin || pt.Y > YLimMax) {
pt.X = Single.NaN;
pt.Y = Single.NaN;
}
aPoint.X = PlotArea.X + (pt.X - XLimMin) *
PlotArea.Width / (XLimMax - XLimMin);
aPoint.Y = 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) { Pen 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((PointF)ds.PointList[i - 1]), cs.Point2D((PointF)ds.PointList[i])); } aPen.Dispose(); } } }