Additional values in pie-chart

2 posts, 0 answers
  1. alex
    alex avatar
    7 posts
    Member since:
    Mar 2016

    Posted 21 Mar Link to this post

     
    data: [{
                        category: "africa",
                        value: 11,
                        value2: 10500,
                    }, {
                        category: "Asia",
                        value: 89,
                        value2: 51351112,
                    }]

    Please tell me, how to add to the chart value "value2" and display it in a pie-chart?

    simple(screenshot):

     


  2. Patrick
    Admin
    Patrick avatar
    174 posts

    Posted 21 Mar Link to this post

    Hi Alex,

    Please take a look at the following Telerik Dojo which illustrates how to use templates to show your data.  

    To use value2 in the series, set your template(in this case, seriesDefaults.labels.template):

    seriesDefaults: {
       labels: {
         visible: true,
         background: "transparent",
         template: "#= dataItem.category #: \n #= dataItem.value #% (#= dataItem.value2 # Million People)"
       }
     }

    In the tooltip, I used templates as well:
    tooltip: {
        visible: true,
        template: "#=dataItem.category#: #= dataItem.value2 # Million People (#=dataItem.value#%)"
      }


    Also, please check out our helpful documentation for more information about templates.

    Hope this helps clear things.

    Regards,
    Patrick
    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
Back to Top