Skip to content

Instantly share code, notes, and snippets.

@pranitkhadilkar7
Last active April 6, 2025 09:46
Show Gist options
  • Save pranitkhadilkar7/20fb8685c868f68db2165b80a517aca9 to your computer and use it in GitHub Desktop.
Save pranitkhadilkar7/20fb8685c868f68db2165b80a517aca9 to your computer and use it in GitHub Desktop.
Usage of Highcharts Global Options
// Basic Usage
import Highcharts from 'highcharts';
Highcharts.setOptions({
// Global options that apply to all charts
chart: {
style: {
fontFamily: '"Arial", sans-serif'
}
},
credits: {
enabled: false
}
});
// Advanced Usage
import Highcharts from 'highcharts';
function setHighchartsDefaults() {
Highcharts.setOptions({
// Chart defaults
chart: {
style: {
fontFamily: '"Benton Sans", Arial, sans-serif'
},
marginTop: 20
},
// Legend configuration
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
padding: 40
},
// Disable credits
credits: {
enabled: false
},
// Plot options for specific chart types
plotOptions: {
pie: {
cursor: 'pointer',
showInLegend: true,
borderWidth: 0
},
gauge: {
dataLabels: {
align: 'center',
enabled: true,
style: { color: '#131517' }
}
}
}
});
}
setHighchartsDefaults();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment