Comments (5)
I've found a solution that works for me. Before exporting, I adjust the body zoom based on the current browser zoom level:
document.body.style.zoom = (1 / window.devicePixelRatio);
Then, I recreate the chart. This ensures that the exported chart maintains its appearance, regardless of the browser zoom level.
from amcharts4.
You can set minimum dimensions of the exported file:
https://www.amcharts.com/docs/v4/concepts/exporting/#Dimension_constraints
Hopefully, that helps.
from amcharts4.
Thank you for your response. While setting minimum dimensions for the exported file does help in controlling the overall size, it doesn't address the core issue I'm facing. The problem persists in maintaining the chart's appearance as it would be at 100% browser zoom, regardless of the user's actual browser zoom setting.
To provide further context, the challenge arises particularly with pie charts, where percentage labels become disproportionately large with higher browser zoom levels, leading to overlapping with the chart itself. Therefore, while controlling dimensions is helpful, it doesn't resolve the issue of maintaining the chart's visual integrity across different browser zoom levels.
Here is how my pie chart looks on 100%:
And how it looks on 250% zoom:
Unfortunately, I can't provide code for this particular chart, that's why I am trying to find solution on the example from documentation first. Later I'll be able to implement same solution in my application also.
Basically I am interested if it's possible to prevent browser zoom having any effect on chart itself, because that will automatically be a solution for exporting also.
from amcharts4.
In that case you may try scaling export image:
https://www.amcharts.com/docs/v4/concepts/exporting/#Scaling_images
from amcharts4.
Scaling the export image also doesn't resolve the core issue.
While it adjusts the size of the exported image, it doesn't ensure consistency with the desired appearance. I will just get the bad looking chart in a smaller dimensions.
It would be the best if it's possible to force the chart to be recreated before exporting and to be recreated as when it's 100% browser zoom, no matter how zoomed the webpage currently is.
from amcharts4.
Related Issues (20)
- Remove Fill color from Pictorial Stacked Chart HOT 4
- In a FunnelSeries chart, how can I show labels in the sliceLinks? HOT 2
- How to hide the tooltip shown for xAxis title HOT 2
- How to hide the bullets when zoom in or zoomout event called HOT 2
- How bar chart with parent and sub catagory HOT 15
- Amchart 4 Legend In Arabic are not Showing Properly HOT 2
- Unable set label for radar chart as per my requirements HOT 2
- Amchart4 is ignoring null-category in data HOT 3
- minZoomCount for categoryAxis on yAxis HOT 2
- Pie of a Pie (problems with the lines) HOT 2
- How to show text in chart area without overlapping with the bars ? HOT 2
- Local formatter for ValueAxis HOT 2
- [Question] Multiple CandlestickSeries is shifted relative to each other HOT 2
- Wrong cursor position when viewbox and real width/height not matching HOT 3
- Map with clustered points and lines HOT 2
- Center wrapped legend items HOT 2
- How to access legend from another Element HOT 2
- force directed graph : label on edge and graph going out of bounds HOT 3
- Need to add custom percentages in Tooltip instead of default CalculatePercentage in amcharts 4 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amcharts4.