格式化Highcharts图表工具提示点格式化程序中的格式

格式化Highcharts图表工具提示点格式化程序中的格式,highcharts,Highcharts,如何在工具提示格式化程序中显示series.name?目前它只显示{series.name} tooltip: { formatter: function () { return '<b>{series.name}: ' + Highcharts.numberFormat(this.y, 2) + '</b>'; } }, 工具提示:{ 格式化程序:

如何在工具提示格式化程序中显示series.name?目前它只显示{series.name}

 tooltip: {
            formatter: function () {
                return '<b>{series.name}: ' +    Highcharts.numberFormat(this.y, 2) + '</b>';

                }
            },
工具提示:{
格式化程序:函数(){
返回'{series.name}:'+Highcharts.numberFormat(this.y,2)+'';
}
},
编辑:

新的工具提示最初是在c#中创建的 tooltip=new{pointFormat=“\u25CF{series.name}:{point.y:,.1f}
“}; …我可以将这个.y的值覆盖到小数点后2位,但由于显示了系列而被卡住。name

工具提示:{
tooltip: {
        formatter: function () {
            return '<b>' + this.series.name + ': '+ Highcharts.numberFormat(this.y, 2) + '</b>';
            }
        }
格式化程序:函数(){ 返回“+this.series.name+”:“+Highcharts.numberFormat(this.y,2)+”; } }
工具提示:{
格式化程序:函数(){
返回“+this.series.name+”:“+Highcharts.numberFormat(this.y,2)+”;
}
}

我也会这么想,但这并没有呈现任何东西。如果我不使用this.series.name,它只会呈现这个带2位小数的.y。。。还有其他想法吗?你的系列剧有名字吗?我可以看一下你的系列产品吗?因为我在我的电脑上试过这个代码,它很有效。所以这里没有什么问题。我也会这么想,但这并没有呈现任何东西。如果我不使用this.series.name,它只会呈现这个带2位小数的.y。。。还有其他想法吗?你的系列剧有名字吗?我可以看一下你的系列产品吗?因为我在我的电脑上试过这个代码,它很有效。因此,这里没有问题。请附上所有
工具提示
选项。答案可能因您的选项而异(不过,下面的答案应该有效)。请附上所有
工具提示
选项。答案可能因您的选择而异(不过,下面的答案应该有效)。
tooltip: {
        formatter: function () {
            return '<b>' + this.series.name + ': '+ Highcharts.numberFormat(this.y, 2) + '</b>';
            }
        }