Does Form Charts support negative axis values?

4 posts, 0 answers
  1. Hakan
    Hakan avatar
    2 posts
    Member since:
    Aug 2014

    Posted 13 Dec 2016 Link to this post

    Hey everyone,

    Does Xamarin Form Charts support negative chart values? (Especially -y axis) It says it does not supports for Xamarin forms but I'm not quite sure about this info. Does anybody knows? Thanks in advance.

     

     

    ps. added sample chart to the attachment

  2. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    359 posts

    Posted 14 Dec 2016 Link to this post

    Hello Hakan,

    This is indeed supported, see the attached screenshot (you'll see that Oranges has a value of -3).

    Here is the code I used to generate that chart.

    XAML: 

    <telerikChart:RadCartesianChart>
          <telerikChart:RadCartesianChart.HorizontalAxis>
            <telerikChart:CategoricalAxis />
          </telerikChart:RadCartesianChart.HorizontalAxis>
          <telerikChart:RadCartesianChart.VerticalAxis>
            <telerikChart:NumericalAxis />
          </telerikChart:RadCartesianChart.VerticalAxis>
          <telerikChart:RadCartesianChart.Series>
            <telerikChart:LineSeries x:Name="MyLineSeries">
              <telerikChart:LineSeries.CategoryBinding>
                <telerikChart:PropertyNameDataPointBinding PropertyName="Category"/>
              </telerikChart:LineSeries.CategoryBinding>
              <telerikChart:LineSeries.ValueBinding>
                <telerikChart:PropertyNameDataPointBinding PropertyName="Value"/>
              </telerikChart:LineSeries.ValueBinding>
            </telerikChart:LineSeries>
          </telerikChart:RadCartesianChart.Series>
    </telerikChart:RadCartesianChart>


    Code-behind or ViewModel:

    MyLineSeries.ItemsSource = new ObservableCollection<ChartData>
    {
        new ChartData { Category = $"Apples", Value = 2 },
        new ChartData { Category = $"Oranges", Value = -3 },
        new ChartData { Category = $"Peaches", Value = 1 }
    };


    Please let us know if you have any further questions or concerns. Thank you for contacting Support and for choosing Telerik by Progress.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
  3. Hakan
    Hakan avatar
    2 posts
    Member since:
    Aug 2014

    Posted 14 Dec 2016 in reply to Lance | Tech Support Engineer, Sr. Link to this post

    Wow thanks for the answer! :) I was suspicious about this according to the comparison table on http://www.telerik.com/xamarin-ui/chart 

     

     it says 'Support for Negative Axis Values' not available for xamarin forms. I dont know why :S

  4. Lance | Tech Support Engineer, Sr.
    Admin
    Lance | Tech Support Engineer, Sr. avatar
    359 posts

    Posted 14 Dec 2016 Link to this post

    Hello Hakan,

    Thank you for letting us know about the comparison chart. I will have the team review and update the chart on the product page.

    Regards,
    Lance | Tech Support Engineer, Sr.
    Telerik by Progress
    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 Feedback Portal and vote to affect the priority of the items
Back to Top