I want to use this SVG Pie Chart on my Joomla site but the problem is I need to access data from Jdatabase
and feed it to its index.js
$(function(){
$("#pieChart").drawPieChart([
{ title: "Cash", value : 40, color: "#2C3E50" },
{ title: "Fixed Interest", value: 8, color: "#fe4400" },
{ title: "Property", value: 24, color: "#018ab6" },
{ title: "Australian shares", value : 16, color: "#fff100" },
{ title: "Intl. shares", value : 12, color: "#D7DADB" }
]);
});
I need variables having Jdatabase data instead of 40
,8
,24
,16
,12
in the above code. Do I need to pass variable from PHP module
to index.js
file or directly access Jdatabase via index.js
? In any case, how to achieve this?