value axis format labels to positive numbers

3 posts, 1 answers
  1. Amrinder
    Amrinder avatar
    10 posts
    Member since:
    Aug 2012

    Posted 18 Jun 2012 Link to this post

    Hi Kendo Team,

    Scenario:
    I would like to draw two area charts in a single chart such that one of them is drawn above the category axis and the other one below the category axis, with only positive numbers being displayed along the value axis.

    Partial solution:
    I drew one chart with positive values and the other with negative values and it is working as expected i.e. showing negative labels for the chart drawn with negative values. I would like to format the values axis to display positive numbers (for the numbers in negative direction). Is this possible?

    Ideally, I would like to be able to draw the second chart with positive values but in reverse direction (this will help display positive labels for the second chart). I know there is an option to reverse the value axis but not sure how can I use it to draw two charts - one in normal direction and other in reverse.

    Thanks,
    Amrinder
  2. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2622 posts

    Posted 20 Jun 2012 Link to this post

    Hi Amrinder,

    To achieve this you could use a template for the labels of the valueAxis. In this template implement a custom logic, which remove the "minus" symbol. For example: 
    $("#chart").kendoChart({
     //...
      valueAxis:{
        labels: {
          visible: true,
          template: "#= Math.abs(value) #"
        }
      }
     //...
    });

    I hope this helps.

    Regards,
    Iliana Nikolova
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Amrinder
    Amrinder avatar
    10 posts
    Member since:
    Aug 2012

    Posted 20 Jun 2012 Link to this post

    Works great, thanks!

    -Amrinder
Back to Top