Home › forums › Using CanvasJS › Using multiple value from json to create Pie Chart
Tagged: pie chart multiple json values
This topic contains 2 replies, has 3 voices, and was last updated by tructuyenbongda 1 week, 1 day ago.
Well Hello there.
I’m new here.
Can I create Pie Chart from multiple value from json?
Please take a look my json.
(Totalbelum * 100 / t.Totalbelum) as Percentbelum,
(Totalsudah * 100 / y.Totalsudah) as Percentsudah
CROSS JOIN (SELECT SUM(CASE WHEN jasa_akses_inet_sedia = ‘belum’ THEN 1 ELSE 0 END) as Totalbelum FROM form_kuesioner_pengelola C where idprov=1 group by idprov) t
CROSS JOIN (SELECT SUM(CASE WHEN jasa_akses_inet_sedia = ‘sudah’ THEN 1 ELSE 0 END) as Totalsudah FROM form_kuesioner_pengelola C where idprov=1 group by idprov) y
group by idprov
I want to show pie chart that only contain Percentbelum and Percentsudah
Number of slices (data points) in the pie chart are based on the number of dataPoints that you pass. Passing just ‘Percentbelum and Percentsudah’ in the chart-options should work fine in your case. Please take a look at gallery example on Rendering Chart in PHP with Data from database.
If this doesn’t help you fulfill your requirements, kindly share sample project with sample database over Google-Drive or Onedrive, so that we can look into it and help you out.
oh verry nice
You must be logged in to reply to this topic.