I'm trying to plot a series of data on a telerik:RadChart! the chart has 30 items with a data value range from 0 to 30. This works great as in image 1. What I'm trying to achieve is to be able to set the X and Y axis labels in ranges as in image 2, when i try and do this not all the charts are plotted in the plot area of the chart. What I'm trying to achieve is something like image 3 is this possible?
5 Answers, 1 is accepted
0
Hello R,
The Step property of the XAxis indicates that one out of n Ticks will be visible where the n is the value set to the Step property. This means that increasing the Step of the XAxis you are providing smaller range for your Points to be plotted.
What I can suggest is that you set the LabelStep property of the XAxis to 10 and custom Range where the Step is 1. For example:
Greetings,
Evgenia
the Telerik team
The Step property of the XAxis indicates that one out of n Ticks will be visible where the n is the value set to the Step property. This means that increasing the Step of the XAxis you are providing smaller range for your Points to be plotted.
What I can suggest is that you set the LabelStep property of the XAxis to 10 and custom Range where the Step is 1. For example:
RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.XAxis.AddRange(0, 30, 1);
RadChart1.PlotArea.XAxis[0].TextBlock.Text = "0 - 10";
RadChart1.PlotArea.XAxis[10].TextBlock.Text = "11 - 20";
RadChart1.PlotArea.XAxis[20].TextBlock.Text = "21 - 30";
RadChart1.PlotArea.XAxis.LabelStep = 10;
Greetings,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
R
Top achievements
Rank 1
answered on 10 Oct 2011, 07:00 PM
Hi Evgenia, Thank you for your response, that worked and displays all the points on the graph and range labels, but is it possible to position the labels on the axis and show in the attached image.
0
Hi R,
To have the Axis Labels plotted as in your sample image you should increase their Left margin as shown here:
Please feel free to customize the value per your own needs.
Greetings,
Evgenia
the Telerik team
To have the Axis Labels plotted as in your sample image you should increase their Left margin as shown here:
RadChart1.PlotArea.XAxis.Appearance.TextAppearance.Dimensions.Margins.Left = new Telerik.Charting.Styles.Unit(110);
Please feel free to customize the value per your own needs.
Greetings,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
R
Top achievements
Rank 1
answered on 11 Oct 2011, 04:42 PM
Hi Evgenia, this does indeed work in this example, but I probably wasn't clear in what I am trying to achieve. I want to be able plot a number of points on the chart and then programmatically set where the X and Y Axis grid lines appear and depending on where they appear that set the label to the mid-point of the grid lines, as in image5. Is this possible with the Telerik Chart control?
0
Hi R,
By default the GridLines of the Chart always appear where the XAxis Ticks are positioned. However in your case there is no way to make the space between the GridLines different.
Best wishes,
Evgenia
the Telerik team
By default the GridLines of the Chart always appear where the XAxis Ticks are positioned. However in your case there is no way to make the space between the GridLines different.
Best wishes,
Evgenia
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now