Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/3.2/YAxisGrid.cs @ 2508

Last change on this file since 2508 was 1964, checked in by mstoeger, 15 years ago

moved the canvas and the basic types of shapes to their own namespace. #498

File size: 1.5 KB
Line 
1using System.Drawing;
2using HeuristicLab.Visualization.Drawing;
3
4namespace HeuristicLab.Visualization {
5  public class YAxisGrid : WorldShape {
6    private Color color = Color.LightBlue;
7
8    public override void Draw(Graphics graphics) {
9      ClearShapes();
10
11      foreach (double y in AxisTicks.GetTicks(YAxis.PixelsPerInterval,
12                                              Parent.Viewport.Height,
13                                              ClippingArea.Height,
14                                              ClippingArea.Y1)) {
15        LineShape line = new LineShape(ClippingArea.X1, y,
16                                       ClippingArea.X2, y,
17                                       color, 1,
18                                       DrawingStyle.Dashed);
19        AddShape(line);
20      }
21
22      LineShape lineZeroX = new LineShape(0, ClippingArea.Y1,
23                                          0, ClippingArea.Y2,
24                                          color, 3,
25                                          DrawingStyle.Dashed);
26
27      LineShape lineZeroY = new LineShape(ClippingArea.X1, 0,
28                                          ClippingArea.X2, 0,
29                                          color, 3,
30                                          DrawingStyle.Dashed);
31
32      AddShape(lineZeroX);
33      AddShape(lineZeroY);
34
35      base.Draw(graphics);
36    }
37
38    public Color Color {
39      get { return color; }
40      set { color = value; }
41    }
42  }
43}
Note: See TracBrowser for help on using the repository browser.