MaxValue setting causes page error

4 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 20 Mar 2010 Link to this post

     

    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();

     

  2. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 22 Mar 2010 Link to this post

    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
  3. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 22 Mar 2010 Link to this post

    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

  4. Nikolay
    Admin
    Nikolay avatar
    397 posts

    Posted 24 Mar 2010 Link to this post

    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.
Back to Top