我在玩这张图表:
https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/highcharts/demo/packed-bubble-split
Package 气泡分裂,我想使传说(Asia
,Europe
等)出现在每个气泡的中心。events
可以吗?我试过这样的东西:
Highcharts.chart(chartContainer, {
chart: {
type: 'packedbubble',
renderTo: chartContainer,
events: {
render: function() {
const chart = this;
chart.series.forEach(function (series) {
var data = series.data; // Get all the data points for the series
var totalX = 0;
var totalY = 0;
var totalPoints = data.length;
// Calculate the total X and Y coordinates of the data points
})
.add();
});
}
}
},
不走运,我不能把它们放在中间。我想知道是否有一种方法可以实现它。
1条答案
按热度按时间8fsztsew1#
您可以使用下面的插件,它将添加所需的自定义标签,并在动画过程中定位它。
现场演示:https://jsfiddle.net/BlackLabel/v1ew6bLc/
文档:https://www.highcharts.com/docs/extending-highcharts/extending-highcharts