Skip to content

Instantly share code, notes, and snippets.

@pranitkhadilkar7
Created April 6, 2025 13:46
Show Gist options
  • Save pranitkhadilkar7/9248ae0141c53e74538d592b2358f23a to your computer and use it in GitHub Desktop.
Save pranitkhadilkar7/9248ae0141c53e74538d592b2358f23a to your computer and use it in GitHub Desktop.
Responsive Design
const options1 = {
responsive: {
rules: [{
condition: {
maxWidth: 500
},
chartOptions: {
legend: {
layout: 'horizontal',
align: 'center',
verticalAlign: 'bottom'
},
yAxis: {
labels: {
align: 'left',
x: 0,
y: -5
}
}
}
}]
}
};
const option2 = {
chart: {
marginLeft: 70,
marginRight: 40,
height: '60%' // Relative to container
},
responsive: {
rules: [{
condition: {
minWidth: 768 // tablet and desktop
},
chartOptions: {
chart: {
height: '400px' // Fixed height for larger screens
}
}
}]
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment