This is a migrated thread and some comments may be shown as answers.

Get currently visible points on Candlestick chart

6 Answers 33 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 29 Feb 2016, 03:03 PM

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

Sort by
0
Petar Marchev
Telerik team
answered on 03 Mar 2016, 01:45 PM
Hello Jonathan,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jonathan
Top achievements
Rank 1
answered on 03 Mar 2016, 02:07 PM

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.

0
Accepted
Petar Marchev
Telerik team
answered on 07 Mar 2016, 08:29 AM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Jonathan
Top achievements
Rank 1
answered on 07 Mar 2016, 09:55 AM

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.

0
Jonathan
Top achievements
Rank 1
answered on 07 Mar 2016, 09:56 AM
Sorry, I forgot to attach the screenshot...
0
Petar Marchev
Telerik team
answered on 07 Mar 2016, 02:46 PM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ChartView
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Jonathan
Top achievements
Rank 1
Share this question
or