gpt4 book ai didi

highcharts - Highchart 内部 donut 名称作为外部 donut 工具提示的标题

转载 作者:行者123 更新时间:2023-12-04 16:11:50 31 4
gpt4 key购买 nike

我正在尝试将内部 donut 名称设置为 highchart 中外部 donut 工具提示的标题。任何人都可以帮我解决这个问题。在示例中,内部饼图上显示的链接镶边应显示为外部 donut 工具提示中所有镶边故障的标题。

http://www.highcharts.com/demo/pie-donut

谢谢,
萨拉特

最佳答案

您需要自己设置tooltip.formatter打回来。

如果在为图表创建数据时将外部点与内部点联系起来,将会很有帮助。

versionsData.push({
name: data[i].drilldown.categories[j],
browserName: categories[i], //additional property for linking with the inner series
y: data[i].drilldown.data[j],
color: Highcharts.Color(data[i].color).brighten(brightness).get()
});

现在,在格式化程序中,您可以检查名称系列 - 并根据它 - 返回默认格式化程序或修改后的文本,在标题中将包含 point.browserName
tooltip: {
valueSuffix: '%',
formatter: function(tooltip) {
if (this.series.name === 'Versions') {
return ('<span style="font-size: 10px">' + this.point.browserName + '</span><br/>').concat(tooltip.bodyFormatter([this]));
}

return tooltip.defaultFormatter.call(this, tooltip);
}
},

例如: http://jsfiddle.net/wss6896b/

关于highcharts - Highchart 内部 donut 名称作为外部 donut 工具提示的标题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42113063/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com