Example3_4.DataCollection.AddLines C# (CSharp) Method

AddLines() public method

public AddLines ( Graphics g, ChartStyle cs ) : void
g System.Drawing.Graphics
cs ChartStyle
return void
        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();
                }
            }
        }

Usage Example

Esempio n. 1
0
        public override void DrawRect(CGRect dirtyRect)
        {
            var g = Graphics.FromCurrentContext();

            g.Clear(backColor);

            cs.ChartArea = this.ClientRectangle;
            AddData();
            SetPlotArea(g);
            cs.AddChartStyle(g);
            dc.AddLines(g, cs);
            lg.AddLegend(g, dc, cs);
            g.Dispose();
        }
All Usage Examples Of Example3_4.DataCollection::AddLines