AliKH
AliKH

Reputation: 71

Highcharts dynamic property updates when zooming

Is there anyway to change the Axis label sizes (fonts or sizes) when the chart is zoomed to some level? obviously there are some situations where you cannot put font 24 when you see the whole diagram, but rather you want to make the fonts bigger when zoomed.

Thank you,

Upvotes: 1

Views: 733

Answers (1)

Ricardo Lohmann
Ricardo Lohmann

Reputation: 26320

You can do it like the following code:

chart : {
    renderTo : 'container',
    zoomType: 'x',
    events: {
        selection: function() {
            this.yAxis[0].options.labels.style.fontSize = "20px";
        }
    }
}

demo

If you look the reference you'll see that you can change other properties.

Upvotes: 1

Related Questions