Adjust highcharts based on window size
Highcharts.chart('chart_container', { | |
chart: { | |
events: { | |
load: function() { | |
/* On mobile, remove labels */ | |
if ($(window).width() < 900) { | |
this.yAxis[0].update({ | |
title: false, | |
labels: false | |
}) | |
this.yAxis[1].update({ | |
visible: false | |
} | |
this.tooltip.update({ | |
style: { | |
width: Math.min(300, 2*$(window).width()/3) | |
} | |
}) | |
} | |
} | |
} | |
}, | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment