agri
agri

Reputation: 507

Format Highcharts chart tooltip pointFormat in formatter

How to display series.name in tooltip formatter? Currently it displays just {series.name}.

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

                }
            },

EDIT:

new tooltip has been initially created in c# 
tooltip = new { pointFormat = "<span style=\"color:   {series.color}\">\u25CF</span> {series.name}: <b>{point.y:,.1f}</b><br/>" };

...and I am able to overwrite the value this.y to 2 decimal places but get stuck by displaying the series.name

Upvotes: 0

Views: 846

Answers (1)

Rahul Sharma
Rahul Sharma

Reputation: 912

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

Upvotes: 4

Related Questions