小编ign*_*ber的帖子

Highcharts:共享工具提示格式化this.points [i]

如何才能将下图中显示的工具提示显示为共享?

您可能需要查看Highcharts API Reference(特别是有关共享选项的信息):http://api.highcharts.com/highcharts#tooltip.formatter

这是jsfiddle:http://jsfiddle.net/iginisruber/Ltqnab9x/1/

全屏:http://jsfiddle.net/iginisruber/Ltqnab9x/1/embedded/result/

我试过这个,但它不起作用:

tooltip: {
			shared: true,
			formatter: function () {
				var y_value_kwh = (this.points[i].y/1000).toFixed(2);
                return '<span style="font-size: 10px">' + this.key + '</span><br/>' + '<span style="color:' + this.points[i].series.color + '">\u25CF</span> ' + this.points[i].series.name + ': <b>' + y_value_kwh  + ' kWh</b><br/>';
            },
        },
Run Code Online (Sandbox Code Playgroud)

当前代码:

tooltip: {
			//shared: true,
			formatter: function () {
				var y_value_kwh = (this.y/1000).toFixed(2);
                return '<span style="font-size: 10px">' + this.key + '</span><br/>' + '<span style="color:' …
Run Code Online (Sandbox Code Playgroud)

javascript formatting jquery highcharts

8
推荐指数
1
解决办法
2万
查看次数

标签 统计

formatting ×1

highcharts ×1

javascript ×1

jquery ×1