RadChart Scale Series

2 posts, 0 answers
  1. Robert
    Robert avatar
    4 posts
    Member since:
    Mar 2013

    Posted 18 Apr 2013 Link to this post

    Is it possible to scale a chart series by setting a max and min value? I have a RadCartesianChart with X = weight and Y = date values. The weight goes from 0 to 140 but most of my values are all within 120 - 140 range. If I could set the max and min weight values to plus 10% and minus 10% the chart would have more detail. Here is my code
                      <telerikChart:LinearAxis LineStroke="{StaticResource PhoneDisabledBrush}" LineThickness="2"/>
                      <telerikChart:DateTimeCategoricalAxis LabelFitMode="Rotate" DateTimeComponent="Date" LabelFormat="M-yy" ></telerikChart:DateTimeCategoricalAxis>
                  <telerikChart:LineSeries x:Name="lines" Stroke="{StaticResource PhoneAccentBrush}" CategoryBinding="WeighDate" ValueBinding="WeighAmount">

    See attached example to see how the chart has little detail because of the scaling.

    I attempted to set the min and max values from my data but the code failed, object null:

    double myMin = myWs.Min(minW => minW.WeighAmount);
                double myMax = myWs.Max(maxW => maxW.WeighAmount);
                xCartesionChart.Series[0].ItemsSource = myWsSorted;
                lines.MaxHeight = myMax;
               lines.MinHeight = myMin;
  2. Victor
    Victor avatar
    1349 posts

    Posted 23 Apr 2013 Link to this post

    Hi Robery,

    Yes of course. You just need to set the Minimum and Maximum properties of your LinearAxis. It should look like this for example:

    <telerikChart:LinearAxis LineStroke="{StaticResource PhoneDisabledBrush}" LineThickness="2"
    The MinHeight and MaxHeight are different, you almost never need to set those manually.

    the Telerik team
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
Back to Top