Im retrieving JSON Data and assigning those into Javascript and display Chart (im using Chart.js).
[{"name":"yasiru","col1":"300","col2":"50","col3":"100","col4":"40","col5":"120"}]
var pieData = [
{
value: obj[0].col1,
color:"#F7464A",
highlight: "#FF5A5E",
label: obj[0].name
},
{
value: 50,
color: "#46BFBD",
highlight: "#5AD3D1",
label: "Green"
},
{
value: 100,
color: "#FDB45C",
highlight: "#FFC870",
label: "Yellow"
}
];
when i run this. label : obj[0].name correctly show the Yasiru name without any problem. but Value is not.
so i tried just alert(obj[0].col1);
then it shows 300 as i needed. am i doing something wrong?
Here PHP code im using. FYI
$row = mysqli_fetch_array($result);
$response = array('name' => $row['username'],
'col1' => $row['first'],
'col2' => $row['second'],
'col3' => $row['third'],
'col4' => $row['fourth'],
'col5' => $row['five']
);
$responses[]=$response;
pieData[0].value, notpieData[0].Value? The capitalization matters.