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

Blank chart when exporting WordCloud chart #1532

Open
dritani opened this issue May 21, 2024 · 8 comments
Open

Blank chart when exporting WordCloud chart #1532

dritani opened this issue May 21, 2024 · 8 comments
Labels

Comments

@dritani
Copy link

dritani commented May 21, 2024

Question
Hello, when exporting a WordCloud chart I am getting a blank image since it takes some time to perform word arrangement. In AmCharts 4 there exists this workaround but I could not get it to work with AmCharts 5.

Does someone know how to accomplish this? Thank you.

Environment

AmCharts 5.8.0
Chrome 124.0.6367.208

@martynasma
Copy link
Collaborator

Do you have a demo of where export of a chart does not work?

I tried it just now, and was able to export a PNG of a WordCloud just fine.

@dritani
Copy link
Author

dritani commented May 23, 2024

The code is pretty deep within a React.js app but the gist of it is:

    am5wc.WordCloud.new(root, {
        categoryField: 'customCategory',
        valueField: 'customValue',
        angles: [0, 90],
      }),
  const exporting = am5Exporting.Exporting.new(root, {
    extraImages,
    filePrefix: 'chart',
  });

  exporting.download('png');

I tried using setTimeout or listening to the datavalidated event but it still did not work.

@martynasma
Copy link
Collaborator

Do you get any errors in console? Does this happen in all browsers?

Here's my test:
https://codepen.io/team/amcharts/pen/rNgLBxr/2a8992cb9cf2532733496ce8aeea3d96?editors=1000

@martynasma
Copy link
Collaborator

Did you also try removing extraImages?

Or significantly delaying the exporting.download('png') call?

@dritani
Copy link
Author

dritani commented Jun 3, 2024

Yes I tried adding multiple seconds delay for exporting.download('png') and removing extraImages. Have done extensive tests but nothing worked. The export is being triggered programmatically and not through the menu.

@martynasma
Copy link
Collaborator

Can you reproduce it on this CodePen?

https://codepen.io/team/amcharts/pen/rNgLBxr/2a8992cb9cf2532733496ce8aeea3d96?editors=0010

It triggers a download after 5 seconds.

@dritani
Copy link
Author

dritani commented Jun 5, 2024

I wasn't able to reproduce it. We deployed the feature without WordCloud export for now.

@martynasma
Copy link
Collaborator

Have you tried it with the latest version of amCharts? 5.9.11

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

2 participants