-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Best way to export same chart in multiple themes and filetypes? #28
Comments
You should be able to use the (undocumented)
So you could load your chart options into |
Thanks for your response! I tried using
The I was worried this could be caused by some unrelated mistake in my code, so I stripped everything down to the barest essentials, but the issue still remains. Here's my complete simplified JS file: const exporter = require('highcharts-export-server');
const options ={
"chart": {
"type": "pie"
},
"title": {
"text": "Example Title"
},
"subtitle": {
"text": "Example Subtitle"
},
"series": [{
"showInLegend": true,
"dataLabels": {
"enabled": true,
"format": "{y}"
},
"data": [
{
"y": 529,
"name": "Data Sample 1"
},
{
"y": 81,
"name": "Data Sample 2"
}
]
}]
};
const themeOptions = {
"lang": {
"thousandsSep": ","
},
"chart": {
"style": {
"fontFamily": "\"proxima-nova\", sans-serif"
}
},
"colors": [
"#008fc4",
"#46a088",
"#e21836",
"#f5d664",
"#ff6b35",
"#5b507a"
],
"title": {
"style": {
"color": "#353536",
"fontFamily": "\"proxima-nova-soft\", sans-serif",
"fontWeight": "600"
}
},
"subtitle": {
"style": {
"color": "#747476",
"fontWeight": "600"
}
},
"legend": {
"itemStyle": {
"fontWeight": "400",
"color": "#353536"
}
}
};
const settings = {
options: options,
themeOptions: themeOptions,
type: 'svg',
outfile: 'chart.svg'
};
exporter.initPool();
exporter.export(settings, (err, res) => {
exporter.killPool();
process.exit(1);
}); |
Sorry for the delay! bbbbfa1 adds a fix for this, I'll push it to NPM once I've taken care of a couple more issues. Please feel free to reopen if you still experience issues with this. |
Apologies if this is covered somewhere, but I'm new to the library and still wrapping my head around things. 🙂
I'm working on a project where we have the same set of data, but we want to export charts in two formats (SVG and PNG) and two styles (for separate websites with different brand guidelines). Ideally this would happen in Node rather than via the CLI, as the rest of our project is Node-based so it'll be a bit easier to maintain.
As an example, my project directory looks a little like this:
I'm unclear from the documentation and issues I've read if it's actually possible to set the theme in this way, or if I need to compile the themes as JS files in
resources
that assignHighcharts.theme
.Thanks in advance for your help!
The text was updated successfully, but these errors were encountered: