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