Norecords
Norecords

Reputation: 3

Highcharts Series.color doesn't work between 9.x and 10.x with tooltip formatter

I got some problem with Highcharts transition between 9.x and 10.x version. I can't get color of series inside function in tooltip formatter.

tooltip: {
    formatter: function () {
        return this.points.reduce(function (s, point) {
            return s + '<br/>' + "<span style='color:" + point.series.color + "'>\u25CF</span> " + point.series.name + ': ' +
                point.y + 'm';
        }, '<b>' + this.x + '</b>');
    },

...

This is related to Belchertown weewx's skin issue. Please have a look to that FIDDLE Thanks. Onza

Upvotes: 0

Views: 58

Answers (1)

magdalena
magdalena

Reputation: 3695

Thank you for reporting this behaviour! I've created a github issue, that you can track here: https://github.com/highcharts/highcharts/issues/17627

Use another quotation marks configuration to achieve the correct tooltip format:

formatter: function () {
    return this.points.reduce(function (s, point) {
        return s + '<br/>' + '<span style="color:' + point.series.color + '">\u25CF</span>' + point.series.name + ': ' +
            point.y + 'm';
    }, '<b>' + this.x + '</b>');
},

Demo: https://jsfiddle.net/BlackLabel/a2uLhdys/

Upvotes: 0

Related Questions