I would like to be able to force the X axis labels manually for a DataChart.
For example, on a intraday price chart by minute, I would like to have 9:30, 10:30, 11:30, etc...
Hello,
Thank you for your post!
I have been looking into it and have created a small sample application for you. In the sample application I have a CategoryXAxis as XAxis, one property DateInterval of type TimeSpan and one property DateStart of type DateTime. In order to show 30 minutes intervals I have set the DateInterval property to “new TimeSpan(00,30,00)”. Also I have set the format for the labels to "{}{Date:hh:mm:ss}". This way the interval shown for the axis is 30 minutes.
Please find the attached sample application and feel free to let me know if you have any further questions on this matter.
Thank you for your solution, but it works only in a perfect scenario. I have minute by minute date, not half hours.
If we change the datasource to be for example
StockDataPoints = 95;
DateInterval = new TimeSpan(00, 1, 00);
DateStart = new DateTime(2010, 1, 1, 9, 29, 0);
then it doesn't fall on 1/2 hours exactly. I need a way to control the labels when I want them.
Is there a way to accomplish this ?
Thanks,
Dimitri
I managed to achieve what I was looking for by adding a couple of data collections and an extra XAxis label.
I have attached the modified sample. I don't know if there is an easier path to get this to work.
Hello Dimitri,
Thank you for the feedback. I am glad you have found a solution to your issue.