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

XAxis scale and zoom

1 Answer 87 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
jdgoulden
Top achievements
Rank 1
jdgoulden asked on 05 Sep 2008, 06:37 PM
I have a large number of data points that need to be displayed, with the X Axis being the time that is displayed. Samples are taken every 5, 10, or 15 minutes for periods of a Month. What I need to be able to do is display the date when I am not zoomed in and then go to a display of hours on the X-Axis as I zoom in.

I have used the LabelStep property of the PlotArea.XAxis to set how many labels there are but what I would like to do is determine the number of items that are visible in the PlotArea, then as I zoom in to adjust the LabelStep value. Is it possible to find a ration of how far I have zoomed in to calculate the number of visible items? Any help would be appreciated, thank you.

1 Answer, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 09 Sep 2008, 10:48 AM
Hi jdgoulden,

You can use the RadChart.ClientSettings object to check the XScale property. It will tell you the zoom amount for the x axis. You can then try to work-out an heuristic by say combining the control width/height and knowing the font sizes etc., to see what label step you should use. You should also be able to rebind the chart and change the labels of the x-axis from dates to time in accordance to how zoomed the chart is.

In general I think the ClientSettings object will provide you with all the needed info to build your custom business logic. If it is missing something let us know and we will try to help you.

Sincerely yours,
Vladimir Milev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
jdgoulden
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Share this question
or