inside the js code i use html table to push the data
var dps = [];
$("table.table_1 tr").each(function(){
key = $("td:nth-child(2)", $(this)).text();
value = $("td:nth-child(1)", $(this)).text();
if (value == '') {
value = 0;
}
dps.push(['\{ value: ' + Number(value) + ', name: \'' + key + '\' \}']);
});
var echartPie = echarts.init(document.getElementById('echart_pie'), theme);
//var datalabel = $("#cartdatalabel").text();
//var datachart = $("#cartdata").text();
echartPie.setOption({
tooltip: {
trigger: 'item',
formatter: "{b} : {c} ({d}%)"
},
legend: {
x: 'center',
y: 'bottom',
//data: ['Email']
//data: dps.key
},
calculable: true,
series: [{
name: 'Source',
type: 'pie',
radius: '25%',
center: ['48%', '38%'],
// data: [{value: 335,name: 'Email'}]
data:dps
}]
});
But I get the result is different, below is the image result. can help I not sure where is my code problem


