Example3_2.ChartStyle.Point2D C# (CSharp) Method

Point2D() public method

public Point2D ( PointF pt ) : PointF
pt System.Drawing.PointF
return System.Drawing.PointF
        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;
        }

Usage Example

コード例 #1
0
 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();
         }
     }
 }
All Usage Examples Of Example3_2.ChartStyle::Point2D