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

Chart Labels Misplaced

1 Answer 93 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Brett
Top achievements
Rank 1
Brett asked on 30 May 2012, 08:01 PM

I would like to limit the number of X-Axis Label Steps to around 3 or 4 labels.  The amount of data displayed on the chart can vary from just 5 points to hundreds and the number of points for each Pen can vary significantly. 

It is my assumption that the “XAxis.LabelStep” property assumes a constant number of points for each ChartSeriesItemCollection.  I had originally set it to

                Chart1.PlotArea.XAxis.LabelStep = Convert.ToInt32(MaxPoints / 3) +1;

But I get a strange group of characters in the upper left portion of the trend and the incorrect number of Labels created.  Given my objective, what would be the ideal way to specify the number of Labels for the X-Axis?

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 31 May 2012, 01:51 PM
Hello Brett,

We have only seen this problem when you have modified the LabelStep of the YAxis to a value bigger than one. To avoid the problem, set the LabelStep of the YAxis to 1. Instead use the chart1.PlotArea.YAxis.Step to modify the step of the labels. You also need to set the chart1.PlotArea.AutoScale = false (so the Step and MaxValue are taken into account).

If the problem continues, we would appreciate if you open a support ticket and provide us with a sample that exhibits the problem.

About modifying the LabelStep of the XAxis, it is good to set the LabelStep to a number that divides to the item Count. Otherwise the labels won't stick to the major ticks but will be shifted instead.

Greetings,
Steve
the Telerik team

BLOGGERS WANTED! Write a review about Telerik Reporting or the new Report Designer, post it on your blog and get a complimentary license for Telerik Reporting. We’ll even promote your blog and help bring you a few fresh readers. Yes, it’s that simple. And it’s free. Get started today >

Tags
General Discussions
Asked by
Brett
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or