Hi
I would like to ask if there is an easy solution to create a grid on the x-axis of a datecontinuous axis.
e.g. every x second/minute/hour depending on the total timespan shown in the chart there will be a tick/grid line. independent if there exist a value for that specific datetime
thanks for your help!
3 Answers, 1 is accepted
You can check out the article on CartesianChartGrid and PolarChartGrid which has information and samples on how to include a grid into your plot area.
The default behavior of the DateTimeContinuous axis is to include ticks at even intervals independent of whether there exist a corresponding value in the view models for this date or not. If you would like to control this interval, you can use the MajorStep and the MajorStepUnit properties of the axis. For example if you would like to have a gridline/tick for each month, your xaml would look like this:
<
telerik:DateTimeContinuousAxis
LabelFitMode
=
"MultiLine"
MajorStepUnit
=
"Month"
MajorStep
=
"1"
LabelFormat
=
"MMM yyyy"
/>
I hope this helps.
Regards,
Anna
Telerik
Hi Anna,
thanks for your post
I have a timebar connected to a chartview. ​Depending on the selected timespan in the timebar the chartview is updated. The timebar can display up to years of sensordata which interval in 500 milliseconds. The data is sampled with chartdatasource. It is also possible to zoom into the timebar, which leads to more detailed representation of the data.
Now i would like to
1) always show a minimum count of labels
2) add annotations which show the timespan between the axis-ticks and if possible time elapsed after visiblerange.min
thanks
KA
I found a similar approach at here but there the
1) always show a minimum count of labels
2) add annotations which show the timespan between the axis-ticks and if possible time elapsed after visiblerange.min
I am a little unsure where you want to add this annotation. You can use the Annotations property of the chart if you need to add chart annotations. The chart annotations are usually some visuals in the plot area which emphasize data and so are data dependent. What you seem to need is not such an annotation, because it is not related to specific data.
You shouldn't have any problems with the content of this annotation - since you manually set the step unit and step, you know what is the distance between two ticks.
Regards,
Petar Marchev
Telerik