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

Labels different from MajorStep

5 Answers 59 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
Håkan
Top achievements
Rank 1
Håkan asked on 24 Jan 2013, 10:49 AM
Hi,

I have a chart that displays time on the horizontal axis.
I have MajorStep set to 15 minutes.
But is it possible to display the label for each hour instead?

I show 24 hours, and when having a label for each quarter they will overlap, even though I rotate them.
It would be nice to have labels for 00:00, 01:00, 02:00 and so on instead of 00:00, 00:15, 00:30, 00:45...
But i still want the ticks for each quarter.

The ScheduleView for example has both MajorTicks and MinorTicks, but I can't seem to find a similar Major/MinorStep for the ChartView.
A nice feature in this case would be that the labels follow the MajorStep and the ticks follow a MinorStep property.

Regards,
Håkan

5 Answers, 1 is accepted

Sort by
0
Accepted
Petar Kirov
Telerik team
answered on 29 Jan 2013, 11:04 AM
Hi Håkan,

You can achieve this effect by setting the LabelInterval property of the DateTimeContinuousAxis to 4. Basically this property will make the chart place a label on every 4 major steps.

I hope this was helpful.

Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Håkan
Top achievements
Rank 1
answered on 29 Jan 2013, 02:41 PM
Hi Petar!

Thanks for the reply, it works just fine!
I thought I hade looked at all Label properties, but it seems I missed this one :-)

Just one more question, the LabelInterval is not a dependency property right?
I tried to bind it to my ViewModel, since the user can select different intervals in a drop down.
But that generates a binding error saying:
"Object of type 'System.Windows.Data.Binding' cannot be converted to type 'System.Int32'."

Not a big deal, I just have to do it in code behind, but it would have been cleaner to bind it.

Regards,
Håkan
0
Petar Kirov
Telerik team
answered on 31 Jan 2013, 08:44 AM
Hi Håkan,

I'm glad to hear that my last post was helpful.

All RadChartView axes inherit from the Axis class, which exposes the LabelInterval property which is in fact a DependencyProperty. I'm not quite sure why you could not bind it successfully to your ViewModel. I've made a simple project to test it and I am attaching it below for reference.
 
All the best,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Håkan
Top achievements
Rank 1
answered on 14 May 2013, 09:24 AM
Hi,

I get the same exception running your example code.

Is this changed recently?
I'm unfortunately stuck with Silverlight 4 at the moment so I'm running the 2012 Q2 SP2 version.

Regards,
Håkan
0
Petar Kirov
Telerik team
answered on 17 May 2013, 08:37 AM
Hi Håkan,

We changed the Axis.ShowLabelsAxis.LabelInterval and
Axis.LabelFitMode properties to dependency properties with the Q3 2012 release (ver. 2012.3.1017). I am afraid that with the version that you are using, you will not be able to bind them.
 
Regards,
Petar Kirov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ChartView
Asked by
Håkan
Top achievements
Rank 1
Answers by
Petar Kirov
Telerik team
Håkan
Top achievements
Rank 1
Share this question
or