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

Limiting xaxis labels

3 Answers 143 Views
Chart (obsolete as of Q1 2013)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
ongle
Top achievements
Rank 1
ongle asked on 07 Aug 2007, 09:33 PM
Does anybody know how to limit the number of labels on the xaxis? I have a chart that is databound with multiple series defined. The xaxis is Time and I don't need every single timestamp printed at the bottom of the chart. This ends up cluttering the axis and makes the labels unreadable. What i'd like to do is limit the number of xaxis labels displayed (either by a specific number of labels, or specific times [e.g. every half hour]). Does anybody have any ideas?

3 Answers, 1 is accepted

Sort by
0
Dwight
Telerik team
answered on 08 Aug 2007, 01:03 PM
Hello Donald,

The feature to restrict the number of displayed labels is already implemented, but it will be available in the Q2 release, which is scheduled for mid September.

What you can do as a work-around until then is to hide some of the x-axis labels so that they are not displayed:
 
for (int i = 0; i < radChart1.PlotArea.XAxis.Items.Count; i++) 
    radChart1.PlotArea.XAxis.Items[i].Visible = (i % 7 == 0); 
 
*  In this example, for each group of 5 elements, the first will be visible and the next 4 - hidden.

Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Dimondwoof
Top achievements
Rank 1
answered on 13 Sep 2007, 04:08 PM
I can't get this to work.  Under radChart1.PlotArea, there is no XAxis property.  I am using the Q1 2007 control.  I am displaying 18 months worth of data and I want the XAxix label to display the month and year only, but the data points need to be daily.
0
Dwight
Telerik team
answered on 14 Sep 2007, 09:20 AM
I see. The code I sent you is for the latest available version, i.e. Q1 2007 SP2.

The version you use is the first version of RadChart. Its API has been extended since and you can try the latest version. Or you can wait until next week when we will release the new version of RadChart.

 
Regards,
Evtim
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Chart (obsolete as of Q1 2013)
Asked by
ongle
Top achievements
Rank 1
Answers by
Dwight
Telerik team
Dimondwoof
Top achievements
Rank 1
Share this question
or