0
CategoryAxis for CandleStickAndVolumeSeries
Hi all,
I am making a candlestick chart to plot financial data and realised the datetime axis isn't the perfect fit for this as it will show gaps when the market are closed, while a proper graph should just join the data.
So I tried to do the trick using a category axis. It will be a bit harder as I will have to manage through code the format of the axis (going from a hh:mm to a dd MMM yyyy while dezooming) but this should be manageable.
My only problem now is that nothing is shown by the plotmodel. I guess this comes from the fact that the CandleStickAndVolumSeries refers X as double, while my axes is labelled. So how can I "explain" to the plot model that when he has 38016.69 for X it should make it appear on the 30 jan. 2004 label of my axis? Note that the CandleStickAndVolumSeries and the axis data follow the same order (indexes or equivalent).
I checked in the example but I couldn't find anything relevant.
Any help will be greatly appreciated
I am making a candlestick chart to plot financial data and realised the datetime axis isn't the perfect fit for this as it will show gaps when the market are closed, while a proper graph should just join the data.
So I tried to do the trick using a category axis. It will be a bit harder as I will have to manage through code the format of the axis (going from a hh:mm to a dd MMM yyyy while dezooming) but this should be manageable.
My only problem now is that nothing is shown by the plotmodel. I guess this comes from the fact that the CandleStickAndVolumSeries refers X as double, while my axes is labelled. So how can I "explain" to the plot model that when he has 38016.69 for X it should make it appear on the 30 jan. 2004 label of my axis? Note that the CandleStickAndVolumSeries and the axis data follow the same order (indexes or equivalent).
I checked in the example but I couldn't find anything relevant.
Any help will be greatly appreciated
Customer support service by UserEcho
So I added this little line of code :
private CandleStickAndVolumeSeries ModifyCandlestick(CandleStickAndVolumeSeries css)
{
for (int i = 0; i < css.Items.Count; i++)
{
css.Items[i].X = i;
}
return css;
}
I also keep the original record which is the one that is public even though it is not plotted to my PlotModel. It allows to the original date time coordinate.