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

MaxValue setting causes page error

3 Answers 45 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 20 Mar 2010, 05:17 PM

 

I'm trying to figure out how to use SeriesMapping from your various examples and I have come up with a strange error.  My silverlight page, where this is taking place, is called "MyGame and some of the code is pasted below.  I'm trying to limit the x axis to 18 but the the line that sets maxvalue causes a page not found in silverlight.  If I remove the instruction the graph displays ok but shows a maxvalue of 20.  How could setting this value cause the page not to be found.
Thanks,
Gary

SeriesMapping
seriesMapping = new SeriesMapping();

 

seriesMapping.LegendLabel =

"Fatigue Last 9 Games";

 

seriesMapping.SeriesDefinition =

new SplineSeriesDefinition();

 

seriesMapping.ChartArea.AxisX.MaxValue = 18;       <-----------causes page not found error

seriesMapping.ItemMappings.Add(

new ItemMapping("Month", DataPointMember.XValue));

 

seriesMapping.ItemMappings.Add(

new ItemMapping("Quantity", DataPointMember.YValue));

 

 

FatigueChart.SeriesMappings.Add(seriesMapping);

FatigueChart.ItemsSource =

this.CreateData();

 

3 Answers, 1 is accepted

Sort by
0
Grtjn
Top achievements
Rank 1
answered on 22 Mar 2010, 08:35 AM
In order to set your X and YValues yourself you have to set the autorange to false.
In my case I had to do this with my radchart.

RadChart.DefaultView.ChartArea.AxisY.AutoRange =

false;

 

RadChart.DefaultView.ChartArea.AxisY.MinValue = 0;

RadChart.DefaultView.ChartArea.AxisY.MaxValue = 100;


Hopes this helps!

Gertjan
0
Gary Blakely
Top achievements
Rank 1
answered on 22 Mar 2010, 05:05 PM

The following had no effect to eliminate this strange error:

 

FatigueChart.DefaultView.ChartArea.AxisY.AutoRange =

false;

 

seriesMapping.ChartArea.AxisY.MaxValue = 4;

seriesMapping.ChartArea.AxisX.MaxValue = 18;

I even tried:

 

seriesMapping.ChartArea.AxisY.AutoRange =

false;

 


to no avail.
Gary

0
Nikolay
Telerik team
answered on 24 Mar 2010, 04:32 PM
Hello Gary Blakely,

   When you set the axis AutoRange to False, you need to define all three axis variables - MinValue, MaxValue and Step. The recommended approach to do that is through the Axis.AddRange(...) method:

RadChart1.DefaultView.ChartArea.AxisX(1,4,1);

Hope this helps.


Best wishes,
Nikolay
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Grtjn
Top achievements
Rank 1
Gary Blakely
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or