Last active
April 6, 2025 09:46
-
-
Save pranitkhadilkar7/20fb8685c868f68db2165b80a517aca9 to your computer and use it in GitHub Desktop.
Usage of Highcharts Global Options
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Basic Usage | |
import Highcharts from 'highcharts'; | |
Highcharts.setOptions({ | |
// Global options that apply to all charts | |
chart: { | |
style: { | |
fontFamily: '"Arial", sans-serif' | |
} | |
}, | |
credits: { | |
enabled: false | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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