tags:

views:

26

answers:

1

Hi,

I have two questions about axis labels:

  1. How do I make a label at the Y2-axis, that shows a highlighted label following the dynamic price (y2-value) of the last bar/candlestick? As the red label in this example: http://img405.imageshack.us/img405/1266/ss20100928025912.png And possibly also the same on the XAxis, showing the time of the last bar.

  2. Also I wonder how to make the time axis plot only every 30 min, and also that it should be full half hours, not arbitrary 30 min spots.. As also shown in the above image.

ZedGraph is awesome. But takes some time to figure out the tricks and tweaks.. :)

+1  A: 

Ad. 1. You probably need to create a custom text object. If I remember correctly:

TextObj label = new TextObj("some text", 1, y2coordinate);              
label.Location.CoordinateFrame = CoordType.XChartFractionY2Scale;
label.Location.AlignH = AlignH.Left;
myPane.GraphObjList.Add(label);

to change the color and background, just edit properties of label.FontSpec

Ad. 2. You need to set manualy the Min, Max and MajorStep of the Scale object of your axis.

Gacek
Wow, really nice with the label. I would never have guessed this :) Thanks!
bretddog
have you managed how to use min/max/step to solve your second problem or do you have any other questions?
Gacek
I had to drop that one a bit down on my priority/task list. Have so many things to fix.. Will get back to it later. Really appreciate your help :)
bretddog