Change X axis values.

Thread is closed for posting
4 posts, 0 answers
  1. Georgio
    Georgio avatar
    1 posts
    Member since:
    Nov 2013

    Posted 07 Nov 2013 Link to this post

    My question might be silly. I'm new to this.

    In the image that I attached, you can see that I'm not doing anything special. Just some basic stuff.

    What I want to do is to change the values "1", "2", "3", "4" on the X axis.

    These values are generated automaticly and I don't know how to change them / disable them.

    Here is my xaml.

    Let's say that instead of "1" I want "25". How do I do that? 
  2. Rosy Topchiyska
    Rosy Topchiyska avatar
    586 posts

    Posted 12 Nov 2013 Link to this post

    Hello Georgio,

    Thank you for your interest in RadControls for WindowsPhone!

    The objects that can be displayed on a RadCartesianChart with a CategoricalAxis are represented by the CategoricalDataPoint class. It has a Value and Category properties that define the position of the point on the chart. If you do not set a Category property, its value will be auto-generated in the same order that the CategoricalDataPoint is added to the DataPoints collection. The Category is of type object, and the axis label is its string representation.

    In the provided example you have to set the Category property of the data points:
        <chartEngine:CategoricalDataPoint Value="107" Category="25"/>
        <chartEngine:CategoricalDataPoint Value="105" Category="lion"/>
        <chartEngine:CategoricalDataPoint Value="106" Category="apples"/>
        <chartEngine:CategoricalDataPoint Value="102" Category="28"/>

    I hope this was useful. Please, feel free to reach back to us with further questions.

    Rositsa Topchiyska
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. Shivang
    Shivang avatar
    1 posts
    Member since:
    May 2014

    Posted 13 Jun 2014 in reply to Rosy Topchiyska Link to this post

    I wanted to do a similar thing too. Is there anyway to do it in the c# code?
  4. Ivaylo Gergov
    Ivaylo Gergov avatar
    691 posts

    Posted 16 Jun 2014 Link to this post


    Yes, these classes can be created also in c#. For example: 

    RadCartesianChart chart = new RadCartesianChart();
    LineSeries series = new LineSeries();
    series.DataPoints.Add(new CategoricalDataPoint(){ Value = 10, Category = "first"});

    Let me know should you have any questions.

    Ivaylo Gergov

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top