Question

I'm trying to use Telerik's RadChart (Spline) on WP7 to display the hourly temperature forecast. I'm having a hard time finding information on how to set the horizontal-axis to group by hour. The examples project contains a chart grouped by month, but when I change

DateTimeComponent="Month" LabelFormat="MMM yyyy"

to:

DateTimeComponent="Hour" LabelFormat="hh ddd"

I get a divide-by-zero error when it tries to build the axis.

Here is an example of what I'm trying to achieve:

NOAA Hourly Weather Forecast Graph

Anyone know of a tutorial or what I might be doing wrong?

Thanks

Was it helpful?

Solution 2

What solved it for me was to switch DateTimeCategoricalAxis to a DateTimeContinuousAxis. I found the examples in the Telerik samples app very helpful.

<telerikChart:DateTimeContinuousAxis
    LabelFitMode="MultiLine"
    LabelFormat="htt"
    MajorStep="6"
    LabelStyle="{StaticResource PhoneTextSmallStyle}"
    MajorStepUnit="Hour"
    PlotMode="OnTicks" />

OTHER TIPS

For the LabelFormat can you please try "h tt"? I don't have access to try right now, but that should work. The format would be "3 PM"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top