Highchairs 如何在图例前添加 HTML
Highchairs how to prepend HTML to legend
我正在使用 highcharts,我想在自动生成的图例前添加一些 html。
legend: {
useHTML: true,
labelFormatter: function(){
return '<div>Div that I want to prepend</div>';
}
}
上面的代码将替换图例而不附加到它。
谁能告诉我如何添加到图例而不是覆盖图例?
labelFormatter: function () {
return this.name + '<div>Div that I want to prepend</div>';
}
var chart = new Highcharts.Chart({.......});
$(chart.legend.group.div).find('span').append('<div>Div that I want to prepend</div>');
我正在使用 highcharts,我想在自动生成的图例前添加一些 html。
legend: {
useHTML: true,
labelFormatter: function(){
return '<div>Div that I want to prepend</div>';
}
}
上面的代码将替换图例而不附加到它。
谁能告诉我如何添加到图例而不是覆盖图例?
labelFormatter: function () {
return this.name + '<div>Div that I want to prepend</div>';
}
var chart = new Highcharts.Chart({.......});
$(chart.legend.group.div).find('span').append('<div>Div that I want to prepend</div>');