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

Export as PNG function #82

Closed
1 of 3 tasks
markov00 opened this issue Feb 28, 2019 · 1 comment · Fixed by #451
Closed
1 of 3 tasks

Export as PNG function #82

markov00 opened this issue Feb 28, 2019 · 1 comment · Fixed by #451
Labels
enhancement New feature or request :export Exporting related issue released Issue released publicly

Comments

@markov00
Copy link
Member

Is your feature request related to a problem? Please describe.
I want to be able to save the chart as PNG image. This can be used to simplify client side export in Kibana.

Describe the solution you'd like
Add the possibility to export the chart as a PNG via a function call to the chart.
Konva has the possibility to get the DataURL from the Stage object (see https://konvajs.org/docs/data_and_serialization/Stage_Data_URL.html)

 const dataURL = stage.toDataURL();

This, btw, will only save the chart into a PNG, not the whole chart with the legend.
A possibility for that is illustrated on https://github.com/tsayen/dom-to-image#how-it-works
but is basically the following:

  • clone the DOM element of the legend
  • inline all the styles
  • create an SVG with a foreignObject with the cloned DOM element
  • save the SVG as image from js
  • copy and paste the image of the legend and the chart into a new image.

Describe alternatives you've considered
The legend can be rendered in canvas, but it's quite difficult and we need to move the whole action logic to a canvas element.
Another option is to render subsequentially a static legend on the chart canvas with only colors and texts of the existing legend.

Additional context
n/a

Kibana Cross Issues
Add any Kibana related issues/feature requests here.

Checklist

  • this request is checked against already exist requests
  • every related Kibana issue is listed under Kibana Cross Issues list
  • kibana cross issue tag is associated to the issue if any kibana cross issue is present
@markov00 markov00 added the enhancement New feature or request label Feb 28, 2019
@markov00 markov00 mentioned this issue Feb 28, 2019
93 tasks
@markov00 markov00 added this to the 7.1 milestone Feb 28, 2019
@markov00 markov00 added the :export Exporting related issue label Feb 28, 2019
@markov00 markov00 changed the title [export] Export as PNG function Export as PNG function Feb 28, 2019
@markov00 markov00 modified the milestones: Kibana 7.2, Kibana 7.3 May 22, 2019
@rshen91 rshen91 mentioned this issue Nov 14, 2019
5 tasks
rshen91 added a commit that referenced this issue Nov 22, 2019
- Add PNG export of chart (including IE11!)
- Story added in Interactions section 

Closes #82
markov00 pushed a commit that referenced this issue Nov 25, 2019
# [14.2.0](v14.1.0...v14.2.0) (2019-11-25)

### Features

* add PNG export ([#451](#451)) ([e844687](e844687)), closes [#82](#82)
@markov00
Copy link
Member Author

🎉 This issue has been resolved in version 14.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@markov00 markov00 added the released Issue released publicly label Nov 25, 2019
AMoo-Miki pushed a commit to AMoo-Miki/OpenSearch-Dashboards that referenced this issue Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request :export Exporting related issue released Issue released publicly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant