Search in sources :

Example 1 with Exporting

use of com.vaadin.addon.charts.model.Exporting in project charts by vaadin.

the class ExportingExample method getChart.

@Override
protected Component getChart() {
    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSpacing(true);
    verticalLayout.addComponent(new Label(getDescription(), ContentMode.HTML));
    Chart chart = (Chart) super.getChart();
    // Enabling exporting adds a button to UI via users can download the
    // chart e.g. for printing
    Exporting exporting = new Exporting(true);
    // One can customize the filename
    exporting.setFilename("mychartfile");
    // Exporting is by default done on highcharts public servers, but you
    // can also use your own server
    // exporting.setUrl("http://my.own.server.com");
    // Actually use these settings in the chart
    chart.getConfiguration().setExporting(exporting);
    // Simpler boolean API can also be used to just toggle the service
    // on/off
    // chart.getConfiguration().setExporting(true);
    verticalLayout.addComponent(chart);
    return verticalLayout;
}
Also used : Exporting(com.vaadin.addon.charts.model.Exporting) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) Chart(com.vaadin.addon.charts.Chart)

Example 2 with Exporting

use of com.vaadin.addon.charts.model.Exporting in project charts by vaadin.

the class AdvancedUse method chartsAdvancedExportSnippet2.

public void chartsAdvancedExportSnippet2() {
    Chart chart = new Chart();
    Exporting exporting = new Exporting(true);
    exporting.setFilename("mychartfile.pdf");
    chart.getConfiguration().setExporting(exporting);
}
Also used : Exporting(com.vaadin.addon.charts.model.Exporting) Chart(com.vaadin.addon.charts.Chart)

Example 3 with Exporting

use of com.vaadin.addon.charts.model.Exporting in project charts by vaadin.

the class AdvancedUse method chartsAdvancedExportSnippet3.

public void chartsAdvancedExportSnippet3() {
    Exporting exporting = new Exporting(true);
    exporting.setUrl("http://my.own.server.com");
}
Also used : Exporting(com.vaadin.addon.charts.model.Exporting)

Aggregations

Exporting (com.vaadin.addon.charts.model.Exporting)3 Chart (com.vaadin.addon.charts.Chart)2 Label (com.vaadin.ui.Label)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1