Loading...
Important Notice - Forums is archived

To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Product icon
TUTORIAL

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.

Export vaadin chart to CSV

Benjamin Larsen
5 years ago May 02, 2016 8:15am
Benjamin Larsen
5 years ago May 02, 2016 8:22am
Guillermo Alvarez
5 years ago May 05, 2016 7:48pm

Hi, 

I must admit I was a bit doubtful about how this would work, but did a small test and seems to be working fine.

  1. Add HighchartsPluginResources similar to HighchartResources class in client package and create a TextResource for the plugin js file.
  2. Add plugin js file in same folder but under src/main/resources.
  3. Create HighchartsPluginScriptLoader class extending HighchartsScriptLoader. Override injectResources so that both original and new plugin resources are injected.
  4. In project widgetset.gwt.xml file replace the original script loader with extended one:
<replace-with class="uy.com.chartexport.client.HighchartsPluginScriptLoader">
    <when-type-is class="com.vaadin.addon.charts.client.HighchartsScriptLoader"/>
</replace-with>

And remember to enable chart exporting.
 

Guillermo Alvarez
5 years ago May 05, 2016 7:53pm

A simple project with the mentioned changes is available in github https://github.com/alvarezguille/charts-export-csv

Hope this helps!

Benjamin Larsen
5 years ago Jun 28, 2016 9:43am
Guillermo Alvarez
5 years ago Jun 28, 2016 10:13am
Benjamin Larsen
5 years ago Jun 28, 2016 10:19am
Guillermo Alvarez
5 years ago Jun 28, 2016 10:20am