Documentation versions (currently viewingVaadin 8)

Vaadin 8 reached End of Life on February 21, 2022. Discover how to make your Vaadin 8 app futureproof →


Vaadin Charts is a feature-rich interactive charting library for Vaadin. It provides a Chart component. The Chart can visualize one- and two-dimensional numeric data in many available chart types. The charts allow flexible configuration of all the chart elements as well as the visual style. The library includes a number of built-in visual themes, which you can extend further. The basic functionalities allow the user to interact with the chart elements in various ways, and you can define custom interaction with click events.

charts overview
Vaadin Charts

The data displayed in a chart can be one- or two dimensional tabular data, or scatter data with free X and Y values. Data displayed in range charts has minimum and maximum values instead of singular values.

This chapter covers the basic use of Vaadin Charts and the chart configuration. For detailed documentation of the configuration parameters and classes, please refer to the JavaDoc API documentation of the library.

In the following basic examples, which we study further in "Basic Use (Java)" and "Basic Use (Web Components)", we demonstrate how to display one-dimensional data in a column graph and customize the X and Y axis labels and titles.


Chart chart = new Chart(ChartType.BAR);

// Modify the default configuration a bit
Configuration conf = chart.getConfiguration();
conf.setSubTitle("The bigger they are the harder they pull");
conf.getLegend().setEnabled(false); // Disable legend

// The data
ListSeries series = new ListSeries("Diameter");
series.setData(4900,  12100,  12800,
               6800,  143000, 125000,
               51100, 49500);

// Set the category labels on the axis correspondingly
XAxis xaxis = new XAxis();
xaxis.setCategories("Mercury", "Venus",   "Earth",
                    "Mars",    "Jupiter", "Saturn",
                    "Uranus",  "Neptune");

// Set the Y axis title
YAxis yaxis = new YAxis();
  "function() {return Math.floor(this.value/1000) + \' Mm\';}");


Web Components:

<!DOCTYPE html>
  <script src="bower_components/webcomponentsjs/webcomponents-lite.js"></script>
  <link rel="import" href="bower_components/vaadin-charts/vaadin-bar-chart.html">
  <div style="width:400px;height:300px">
      <subtitle>The bigger they are the harder they pull</subtitle>
        <categories>Mercury, Venus, Earth, Mars,
                    Jupiter, Saturn, Uranus, Neptune</categories>
        <labels formatter = "function () { return this.value / 1000 + 'Mm';}">
      <data-series name="Diameter">
          4900, 12100, 12800, 6800,
          143000, 125000, 51100, 49500

The resulting chart is shown in Basic Chart Example.

charts basicexample
Basic Chart Example


Vaadin Charts is a commercial product licensed under the VCL-2 License (Vaadin Commercial License and Service Terms). You need a license for all Charts use, including web deployments as well as intranet use. See pricing for details.