Maulik sojitra
Maulik sojitra

Reputation: 110

Highcharts y-axis labels removed after zoom out

I have used highcharts 7.0.2 version.

In my application initially, charts line charts are bound properly but after zoom in and zoom out it will create an issue on axis labels.

Below are some snaps for the same.

Also, I have used the zooming on 'xy' axis.

 chart: {
    zoomType: 'xy'
    }

1) Chart before zoom out

enter image description here

2) Charts after zoomout enter image description here

enter image description here

Fiddle demo: https://jsfiddle.net/ukLaqtyv/. To reproduce the issue you have to do very large zoom.

Chart with zoom enter image description here

After click on reset zoom button enter image description here

Upvotes: 0

Views: 568

Answers (1)

ppotaczek
ppotaczek

Reputation: 39099

This problem looks like a bug, so I reported it on Highcharts github: https://github.com/highcharts/highcharts/issues/10516

To workaround, you can set tickPositions again by the update method:

yAxis: {
    events: {
        afterSetExtremes: function(e) {
            if (
                typeof e.userMin == 'undefined' &&
                typeof e.userMax == 'undefined'
            ) {
                this.update({
                    tickPositions: this.tickPositions
                });
            }
        }
    }
},

Live demo: https://jsfiddle.net/BlackLabel/yx9wtf2p/

API Reference: https://api.highcharts.com/highcharts/yAxis.events.afterSetExtremes

Upvotes: 1

Related Questions