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

Simpe way to mark a range background

3 Answers 43 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
ManniAT
Top achievements
Rank 2
ManniAT asked on 23 Jan 2014, 08:46 AM
Hi,

I attached an image showing what I like to have.

The idea - a chart representing values of a time series (line in the sample - could also be Bar or...).
During the period something happens (let's say it rains) - I know the start end the end time of this event.
Now I want to mark the rain period.

How can this be achived?

And I want the Y axes to be dynamic, so that if a higher value scrolls in it should expand, keeping the marked section to the top.

Last not least - it would be great if that will also work for Windows Phone and Windows 8.

Thank you
Manfred

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 24 Jan 2014, 04:13 PM
Hello Manfred,

Your requirement could be achieved if you use the RadChartView Annotaions and more specifically the CartesianPlotBandAnnotation. In order to highlight a time range in your chart you could create an annotation similar to this one:
<telerik:CartesianPlotBandAnnotation DataContext="{Binding}"
                          From="{Binding FromDate}"
                          To="{Binding ToDate}"
                          Axis="{Binding ElementName=horizontalAxis}"/>

where the Axis property determines with which axis the annotation must be associated, the From property is the starting point of the plot band and To is the ending point.

I prepared a sample project to demonstrate the described approach.

As for your last question, you can use our WPF ChartView in a WPF solution and run it in Windows8. However, if you need a charting component specifically designed for Windows8 development, you can take advantage of the Windows8 RadChart control, which also supports the CartesianPlotBandAnnotation.

For mobile devices you can use the RadControls for Windows Phone, where you could use the same approach with the CartesianPlotBandAnnotation.

Regards,
Martin Ivanov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
ManniAT
Top achievements
Rank 2
answered on 30 Jan 2014, 10:29 AM
Hi Martin,

thank you for the solution!
Telerik support at it's best :)

Manfred
0
ManniAT
Top achievements
Rank 2
answered on 30 Jan 2014, 10:31 AM
I can't mark your post (it also shows you as "missing user") as answer (gives me an error) - and I can't edit my post to add these words.
So with a new Post:

This qeustion is answered!
Tags
ChartView
Asked by
ManniAT
Top achievements
Rank 2
Answers by
Martin Ivanov
Telerik team
ManniAT
Top achievements
Rank 2
Share this question
or