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

Change X axis values.

3 Answers 111 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Georgio
Top achievements
Rank 1
Georgio asked on 07 Nov 2013, 07:21 AM
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.

http://pastebin.com/gqT961mQ

Let's say that instead of "1" I want "25". How do I do that? 

3 Answers, 1 is accepted

Sort by
0
Rosy Topchiyska
Telerik team
answered on 12 Nov 2013, 10:35 AM
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:
<chart:LineSeries.DataPoints>
    <chartEngine:CategoricalDataPoint Value="107" Category="25"/>
    <chartEngine:CategoricalDataPoint Value="105" Category="lion"/>
    <chartEngine:CategoricalDataPoint Value="106" Category="apples"/>
    <chartEngine:CategoricalDataPoint Value="102" Category="28"/>
</chart:LineSeries.DataPoints>

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

Regards,
Rositsa Topchiyska
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Shivang
Top achievements
Rank 1
answered on 14 Jun 2014, 01:57 AM
I wanted to do a similar thing too. Is there anyway to do it in the c# code?
0
Ivaylo Gergov
Telerik team
answered on 16 Jun 2014, 11:55 AM
Hi,

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"});
chart.Series.Add(series);

Let me know should you have any questions.

Regards,
Ivaylo Gergov
Telerik
 

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.

 
Tags
Chart
Asked by
Georgio
Top achievements
Rank 1
Answers by
Rosy Topchiyska
Telerik team
Shivang
Top achievements
Rank 1
Ivaylo Gergov
Telerik team
Share this question
or