export
export copied to clipboard
chart export blurs on zoom
I'm trying to export a chart that is zoomed. This is from a screenshot:
When I export to PNG using this function:
this.chart.export.capture({}, function() {
this.toPNG({
quality: 1,
multiplier: 2
}, function(data) {
this.download(data, 'image/png', 'chart.png')
})
})
The PNG blurs like this:
I'm using guides
so I had to set the minimum
and maximum
of the axis explicitly.
Thank you.
That looks a little too blurry, I agree! Do you have your chart online somewhere, so we can have a closer look? Also, can you provide some details, like browser and OS where this is happening?
I managed to create a codepen that reproduces the issue, here it is:
https://codepen.io/wildan2711/pen/REOOjB?editors=1111
Thanks.
We're trying to get to the bottom of it.
Meanwhile, it looks like it is caused by trend lines. If you remove that section, exports become fine.
Yes, although some of our charts does not blur when using trend lines.
any news on this?
Sorry for the wait.
Export plugin was just updated. It should fix the issue.
Ah sorry, the plugin was not updated. We do have a solution, though.
Please refer to this demo: https://codepen.io/anon/pen/GeOWzg?editors=0010
This section should fix the issue:
"export": {
"backgroundColor": "#ffffff",
"enabled": true,
"reviver": function(obj) {
if ( obj.width > this.setup.chart.realWidth ) {
obj.width = this.setup.chart.realWidth;
}
}
},
Nice, it works! Thanks for the workaround.