Why pie chart is showing data separately 

1
Hi community, I am using anychart to create a pie chart. But pie chart is showing data separately, I don’t know where went wrong. JSON data I created using export mapping :  [ { "hoverinfo": "Apple", "type": "pie", "values": [ 5 ], "labels": [ "Apple" ] }, { "hoverinfo": "Sumsung", "type": "pie", "values": [ 3 ], "labels": [ "Sumsung" ] }, { "hoverinfo": "siemens", "type": "pie", "values": [ 2 ], "labels": [ "siemens" ] }, { "hoverinfo": "Huawei", "type": "pie", "values": [ 60 ], "labels": [ "Huawei" ] } ]  
asked
1 answers
2

HI Hannah Lin,

If you want your values in a single you should have single value array and single label array with all the possible values and labels inside the array. 

Example : 

[

  {

     values: [19, 26, 55],   

     labels: ['Residential', 'Non-Residential', 'Utility'],

    type: 'pie'

  }

];

 

Ref link : https://plotly.com/javascript/pie-charts/#basic-pie-chart

 

Hope it helps!!

answered