Hi,
I'm trying to get the current visible range of values in a Candlestick chart, in order to apply different levels of sampling threshold when zoom changes (in an attempt to get adaptative sampling to solve this issue: http://www.telerik.com/forums/adaptive-sampling-zoom-scrolling). Is there any way to get this value, or the limits of the visible area, or at least know when a point is visible or not when zooming in and out?
Thanks.
6 Answers, 1 is accepted
You can use the ActualVisibleRange property of the axis and see the range that the visible plot area corresponds to. You can then iterate all data points and see which data points have a date in this range. You can get the date from the Category property of the data point. I hope this will suffice.
Regards,
Petar Marchev
Telerik
Hi Petar,
If I'm not mistaken, DateTimeCategoricalAxis doesn't contain the property ActualVisibleRange. Instead, DateTimeContinuousAxis contains it, but using this kind of axis causes my Candlestick chart to look like a mess. This is why I'm using the former.
Regards,
Jonathan.
We think that usually the datetime continuous axis would be a better choice for a financial chart. Otherwise, if you have too many categories, you risk of the axis getting cluttered by so many ticks.
Anyway, if you decide to keep the categorical axis, you can still use a similar approach. The categorical axis has a Categories collection that contains all the categories. You can get the relative zoom from the chart's HorizontalZoomRangeStart/End properties and calculate the first and last visible categories. So, you can still get the items in this range. I hope this helps.
Regards,
Petar Marchev
Telerik
Hello Petar,
The problem with DateTime Continuous is that candles in Candlestick chart are shown too wide. You'll find an attached screenshot that shows this issue.
On the other hand, I'll give it a try using the Categories collection approach.
Thanks,
Jonathan.
You can use the properties of the DateTimeContuousAxis to specify the major step and major step unit. I suggest you give it a go.
Regards,
Petar Marchev
Telerik