我有这样的脚本json,我想将列value_a与总数相除
regional value_a total
SUL 1072 5823
KAL 991 5472
PUMA 253 1832
value_a /总数* 100
series = [{
borderWidth: 0,
data: json[2]['total'],
data: json[1]['value_a'],
dataLabels: {
style: {
fontWeight: "normal"
},
formatter: function() {
var y = this.y;
var percentage = (this.y/json[2]['total']*100).toFixed(2);
return '<div style="text-align:center"><span style="font-size:20px;color:' +
((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'white') + '"><br/>'+ y +'</span><span><small> / ' + percentage + ' %</small></span>';
}
}
}];
但结果显示为NaN
答案 0 :(得分:0)
您可以在查询中创建除法公式,以获取除法结果