Chart X axis text labels

2 posts, 0 answers
  1. Globanet
    Globanet avatar
    6 posts
    Member since:
    Oct 2012

    Posted 21 Dec 2012 Link to this post


    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?  
  2. Missing user
    Missing user avatar

    Posted 25 Dec 2012 Link to this post


    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.

    Ivan N.
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top