Scale Labels in units

4 posts, 1 answers
  1. Sujatha
    Sujatha avatar
    2 posts
    Member since:
    Jul 2013

    Posted 16 Jul 2013 Link to this post

    Is there a way to  represent the scale labels in kilos say 100k, 200k, 1m in the radial Gauge ?
    Since I have to display pointer value 2985653 and scale labels are large.
  2. Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 17 Jul 2013 Link to this post

    Hi Sujatha,

    In order to achieve this you could use a scale.labels.template. For example:

    $("#gauge").kendoRadialGauge({
      //....
      scale: {
         labels: {
             template: "#= value# K"
         }
      }
    });
      Regards,
    Iliana Nikolova
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. Kendo UI is VS 2017 Ready
  4. Sujatha
    Sujatha avatar
    2 posts
    Member since:
    Jul 2013

    Posted 17 Jul 2013 Link to this post

    When I tried the code, the 'K' is getting appended to the label value. I want to automatically convert the numbers 1000 to 1k and display on the gauge scale. How to do that ?
  5. Answer
    Iliana Nikolova
    Admin
    Iliana Nikolova avatar
    2595 posts

    Posted 17 Jul 2013 Link to this post

    Hello Sujatha,

    In order to achieve this you should create a custom function which converts the numbers 1000 to 1k. For example:

    $("#gauge").kendoRadialGauge({
      //....
      scale: {
        //....
        labels: {
            template: "#= Math.round(value / 1000) #k"
        }
     }
    });
      Regards,
    Iliana Nikolova
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready