Skip to content
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

Toolbar PNG export with desired scale or width #4592

Closed
rs-tsc opened this issue Jul 29, 2024 · 2 comments
Closed

Toolbar PNG export with desired scale or width #4592

rs-tsc opened this issue Jul 29, 2024 · 2 comments
Labels

Comments

@rs-tsc
Copy link
Contributor

rs-tsc commented Jul 29, 2024

Summary

We are facing an image blur issue while using the PNG export from the toolbar.

API Changes

  1. Include a couple of options 1. scale & 2. width inside chart -> toolbar -> export -> png
  2. If either of these options is present, it will pass the option to Export's dataURI method, which already has these scale and width options implemented inside it.
  3. If both of them are present, like dataURI method, scale gets higher priority

Intended Use Case

Due to business needs, we are using small canvases and export to PNG from toolbar does provide any option to scale it or make it of desired width. So we need to add options to make it possible.

@rs-tsc rs-tsc added the feature-request New feature or request label Jul 29, 2024
@rs-tsc
Copy link
Contributor Author

rs-tsc commented Jul 29, 2024

The code is implemented and tested locally.

Exports.js

    ...
    exportToPng() {
        const scale = this.w.config.chart.toolbar.export.png.scale
        const width = this.w.config.chart.toolbar.export.png.width
        const options = scale ? {scale: scale}: width? {width: width}: undefined
        this.dataURI(options).then(({ imgURI, blob }) => {
    ...

rs-tsc added a commit to rs-tsc/apexcharts.js that referenced this issue Jul 30, 2024
rs-tsc added a commit to rs-tsc/apexcharts.js that referenced this issue Jul 30, 2024
rs-tsc added a commit to rs-tsc/apexcharts.js that referenced this issue Jul 31, 2024
rs-tsc added a commit to rs-tsc/apexcharts.js that referenced this issue Jul 31, 2024
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant