Line | |
---|
1 | using System.Drawing;
|
---|
2 |
|
---|
3 | namespace HeuristicLab.Visualization {
|
---|
4 | public class YAxis : WorldShape {
|
---|
5 | public const int PixelsPerInterval = 75;
|
---|
6 |
|
---|
7 | private ILabelProvider labelProvider = new DefaultLabelProvider("e");
|
---|
8 |
|
---|
9 | public ILabelProvider LabelProvider {
|
---|
10 | get { return labelProvider; }
|
---|
11 | set { labelProvider = value; }
|
---|
12 | }
|
---|
13 |
|
---|
14 | public override void Draw(Graphics graphics, Rectangle viewport, RectangleD clippingArea) {
|
---|
15 | shapes.Clear();
|
---|
16 |
|
---|
17 | foreach (double y in XAxis.GetTicks(PixelsPerInterval,
|
---|
18 | viewport.Height,
|
---|
19 | ClippingArea.Height,
|
---|
20 | ClippingArea.Y1)) {
|
---|
21 | TextShape label = new TextShape(ClippingArea.X2 - 3, y,
|
---|
22 | labelProvider.GetLabel(y));
|
---|
23 | label.AnchorPositionX = AnchorPositionX.Right;
|
---|
24 | label.AnchorPositionY = AnchorPositionY.Middle;
|
---|
25 | shapes.Add(label);
|
---|
26 | }
|
---|
27 |
|
---|
28 | base.Draw(graphics, viewport, clippingArea);
|
---|
29 | }
|
---|
30 | }
|
---|
31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.