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

Chart X axis text labels

1 Answer 143 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Globanet
Top achievements
Rank 1
Globanet asked on 21 Dec 2012, 02:49 PM
Hello,

I am trying to create chart with text labels on X axis. I know about categorical chart, but in my case this is not an option and I'll tell why.
Each of my items has Count filed, CustomDate field and Label field. Count is used for Y axis. CustomDate is integer value and it is used on X axis. Label field is a string that is generated based on CustomDate and I want it to be displayed on X axis ticks, not CustomDate values. I cannot use XCategory to bind to X axis because chart can calculate difference between CustomDate values, i.e. it knows that there is difference of 5 between 5 and 10. But if use XCategory and string field it cannot calculate difference between for example "5" and "10". But this gap between values on X axis is very important.

So, is there is any possibility to use integer values on X axis using XValue, but to display string labels not these integer numbers?  

1 Answer, 1 is accepted

Sort by
0
Missing User
answered on 25 Dec 2012, 01:03 PM
Hello,

We do not support mixing XValues and string labels out of the box. You can, however, use a workaround by modifying the X axis labels in code-behind after subscribing to an appropriate event. I've attached a sample project demonstrating this, along with a screenshot of the demo app in action. I hope this is an acceptable solution.

Regards,
Ivan N.
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Chart
Asked by
Globanet
Top achievements
Rank 1
Answers by
Missing User
Share this question
or