Chapo
Chapo

Reputation: 2543

Change dataLabels font size when zooming in Highcharts bubble graph

I originally created a graph using highcharts but I couldn't find a solution to this question. To summarize I show correlation between a big number of variables and for different time horizons. So for each couple of variable I have several bubbles whose diameter is proportional to the correlation value. The issue is that when I zoom in, the label size stays the same and is unreadable.

I wanted to implement somthing like this within the definition of my chart:

selection: function(event) {
    this.options.plotOptions.bubble.dataLabels.style.fontSize = somefunction();
}

But it doesn't seem to have any impact. All help welcome !

Upvotes: 2

Views: 6112

Answers (1)

Chapo
Chapo

Reputation: 2543

Thanks to @PawelFus for the pointer.

Solution is to loop through all the series as it can't be done globally. It is extremely slow though : the bubble graph takes more than one second to update after I zoom in.

selection: function (event) {
            for (var s in this.series) {
                this.series[s].update({ 
                    dataLabels: {
                        style:{
                            fontSize: 11
                        }
                    }
                });

            }

Upvotes: 1

Related Questions