Interface DataConverter

All Superinterfaces:
Serializable
All Known Implementing Classes:
DefaultDataConverter

public interface DataConverter extends Serializable
Converts tabular data into chart Series for rendering. The input is a list of rows, where each row is a column-name-to-value map.

Implementations may return one or more series depending on the data. The DefaultDataConverter provides automatic chart type detection based on column names and supports multi-series grouping via a series column. Custom implementations can apply any conversion logic appropriate for their use case.

Since:
25.3
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    List<com.vaadin.flow.component.charts.model.Series>
    Converts tabular data into one or more chart series.
  • Method Details

    • convertToSeries

      List<com.vaadin.flow.component.charts.model.Series> convertToSeries(List<Map<String,Object>> data)
      Converts tabular data into one or more chart series.

      Each element in the input list represents a single row, with column names as keys and column values as values.

      May be called from a background thread, where Vaadin thread locals such as UI.getCurrent() return null, and more than once per chart update. An implementation that depends on UI state, such as the locale for formatting labels, should capture that state when the converter is created rather than read thread locals here.

      Parameters:
      data - the tabular data to convert, not null
      Returns:
      a list of series ready for use in a chart, never null and never empty
      Throws:
      NullPointerException - if data is null