Sparkline | Vaadin

Vaadin Sparkline is a standalone sparkline component for Vaadin Flow

Vaadin Sparkline is a standalone sparkline component for Vaadin Flow. See also Grid Sparkline renderer:

Basic use

public class SparklineTest extends VerticalLayout {

    public SparklineTest() {
        Sparkline sparklineSimple = new Sparkline(createSparklineValues(createSong()));

    private SparklineValues createSparklineValues(Song song) {
        // convert existing time series data to a SparklineValues object
        return new SparklineValues(song.getDailyListeners().getMeasurements().stream()
                     .map(measurement -> new SparklineValues.SparklineValue(
                               measurement.getInstant(), measurement.getValue())).collect(Collectors.toList()));

With Plot bands

public class SparklineTest extends VerticalLayout {

    private void plotBandDemo() {
        Patient patient = createPatient();
        Sparkline sparklinePlotBands = new Sparkline(createSparklineValuesTemp(patient),

    private SparklineConfiguration createSparklineConfTemp(Patient patient) {
            return new SparklineConfiguration()
                    // scale y-axis between min and ax value
                    // add a plotband with line color and background color
                    .withPlotBand(new SparkLinePlotBand(36.0, 38.0)
                    // add a plotband with line color
                    .withPlotBand(new SparkLinePlotBand(38.0, 41.0)

License & Author

This Add-on is distributed under Apache 2.0

Component Factory Sparkline is written by Vaadin Ltd.

Sponsored development

Major pieces of development of this add-on has been sponsored by multiple customers of Vaadin. Read more about Expert on Demand at: Support and Pricing


Link to this version
BetaReleased 11 December 2020Apache License 2.0
Framework Support
Vaadin platform 14
Browser Compatibility
Install with
Release notes - Version 2.0.0
  • Update the license to Apache 2.0
  • Update to Vaadin 14.
  • Change package name from com.vaadin.flow.component to com.vaadin.componentfactory