Esempio n. 1
0
            protected override void OnPaint(ChartGraphics g)
            {
                if (this.Owner.GridVisible)
                {
                    this.SelectGridPen(g);

                    List <ChartHorizontalScale.GridLine> hlines = this.Owner.HorizontalScale.GridLines;
                    for (int i = 0; i < hlines.Count; i++)
                    {
                        int x = hlines[i].X;
                        this.DrawGridLine(g, this.Owner.GridColor, x, 0, x, this.Height);
                    }

                    List <ChartVerticalScale.GridLine> vlines = this.Owner.VerticalScale.GridLines;
                    for (int i = 0; i < vlines.Count; i++)
                    {
                        int y = vlines[i].Y;
                        this.DrawGridLine(g, this.Owner.GridColor, 0, y, this.Width, y);
                    }
                }
                for (int i = 0; i < this.Owner.Figures.Count; i++)
                {
                    this.Owner.Figures[i].WmPaint(g);
                }
                g.SelectPen(this.Owner.BorderColor);
                g.DrawRectangle(0, 0, this.Width - 1, this.Height - 1);
            }
Esempio n. 2
0
 internal void SelectGridPen(ChartGraphics g)
 {
     if (_gridPen == null || _gridPen.Color != this.Owner.GridColor)
     {
         _gridPen = new GdiPen(this.Owner.GridColor, 1, System.Drawing.Drawing2D.DashStyle.Dot);
     }
     g.SelectPen(_gridPen);
 }