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

Additional values in pie-chart

1 Answer 154 Views
Charts
This is a migrated thread and some comments may be shown as answers.
alex
Top achievements
Rank 1
alex asked on 21 Mar 2016, 07:43 AM
 
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):

 


1 Answer, 1 is accepted

Sort by
0
Patrick | Technical Support Engineer, Senior
Telerik team
answered on 21 Mar 2016, 06:13 PM
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!
 
Tags
Charts
Asked by
alex
Top achievements
Rank 1
Answers by
Patrick | Technical Support Engineer, Senior
Telerik team
Share this question
or