hi i have been trying to use data from MYSQL database and use them to create graphical chart with chart.js. i encoded data into JSON data( through a php file name data1.php), now i need to convert these Json data back to array using Jquery or javascript.. i dont have much knowledge about AJAX.. so could u help me out??
data1.php produces JSON data as
[{"company_name":"project A","present_worth":"81531.946062978"},{"company_name":"project B","present_worth":"67313.916593765"},{"company_name":"project c","present_worth":"92440.723376746"}]
i need value of present_worth in an array
this is the script used to create bargraph.. instead of custom data (for eg data : [65,59,90,81,56,55,40])given here i want an array here with JSON data.
<script type="text/javascript">
function bar(){
var barChartData = {
labels :["January","February","March","April","May","June","July"],datasets : [
{
fillColor : "rgba(220,280,220,0.5)",
strokeColor : "rgba(220,220,220,1)",
data : [65,59,90,81,56,55,40]
},
{
fillColor : "rgba(151,187,205,0.5)",
strokeColor : "rgba(151,187,205,1)",
data : [28,48,40,19,96,27,100]
}
]
};
var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Bar(barChartData);
}
</script>