普通地图的话,新建宏,对象选择char,事件选择beforeRenderer,然后将下面的代码复制进去
function main(chartView) {
var op = chartView.getChartObject().getOptions();
var series = op.series;
if (!series) {
return;
}
series[0].label = {
normal: {
show: true,
formatter: function(params) {
debugger;
return params.data.name + ":" + params.data.displayValue;
}
}
}
}
----------------------------------------------------------------------------------
航线图的话,新建宏,对象选择char,事件选择beforeRenderer,然后将下面的代码复制进去
function main(chartView) {
var op = chartView.getChartObject().getOptions();
var series = op.series;
if (!series) {
return;
}
series[0].label = {
normal: {
show: true,
formatter: function(params) {
return params.data.realDisName + ":" + params.data.value;
}
}
}
} |