-
Notifications
You must be signed in to change notification settings - Fork 91
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
charts printed using am5 library appear blurry in the PDF #1605
Comments
You may set quality to a higher number: Also upscale the size using |
I tried the suggested solutions, however It didn't worked and charts are still printing blurry. Adding the code below for reference: for (let i = 1; i <= 3; i++) { |
The next thing to try is enabling pixel ratio: |
Used this one as well, still getting blurry charts in PDF. |
Is perhaps your source chart very small in size? |
No charts are not small in size, charts are given width of parents div which is 100% of container. minWidth: 1000, //tried width: am5.p100 too Here p100 states for 100 percent of parent div |
Try setting both |
Tried 1000, 1500 and even 2000 but that didn't made quality of the charts any better. Can we print charts as canvas elements itself using am5 ? When we are using am4, we get SVG in UI and are able to convert to high quality images in print version. However there is no such method available for printing canvas version in am5 as is with high quality. |
@martynasma I am also getting same issue. Even, I had tried to export canvas/svg using the above code for downloading pdf which use aspose library. ` Promise.all(promise).then(function (values) { ` |
@martynasma Even i am facing same issue. |
@martynasma Experiencing the same issue at my end as well, PDF generated via aspose is not clear enough |
OK, so here's a very small test case: It has two small charts:
Do you have the same results? |
Using |
Perhaps we can add a PDF setting to not try and fit the image into the width of the page. This would solve the bullriness issue as well as size because smaller charts would display smaller, without need to upscale them. Let us experiment with this a little, and get back to you. |
Fixed in 5.10.1. [5.10.1] - 2024-08-09Added
Changed
Fixed
Make sure you clear your browser cache after upgrading. And feel free to contact us again if you are still experiencing this issue. |
Using below code with exporting library (https://cdn.amcharts.com/lib/5/plugins/exporting.js), we are getting blurry charts in PDF that is being printed using aspose. Can we do something to get better quality charts in PDF as UI. @martynasma Please suggest.
for (let i = 1; i <= 3; i++) {
try {
var divId = 'chartdiv' + i;
var root = eval('root' + 1);
var exporting = amSplugins_exporting.Exporting.new(root, {
pngOptions: {
quality: 0.8,
maintainPixelRatio: true
}
});
promise.push(exporting.export("png"));
var node = $("#" + divId)[0];
var elem = $("< img/>")[0];
elem.id = "img" + divId;
node.appendChild(elem);
}
catch (e) { }
}
The text was updated successfully, but these errors were encountered: