Class ChartConfigurationParser

java.lang.Object
com.vaadin.flow.component.ai.chart.ChartConfigurationParser
All Implemented Interfaces:
Serializable

public final class ChartConfigurationParser extends Object implements Serializable
Parses a Highcharts JSON configuration string into a Vaadin Configuration object.
Author:
Vaadin Ltd
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    merge(String configJson, com.vaadin.flow.component.charts.model.Configuration config)
    Parses a JSON configuration string and applies the values onto the given Configuration.
    static com.vaadin.flow.component.charts.model.Configuration
    parse(String configJson)
    Parses a Highcharts JSON configuration string into a new Configuration object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parse

      public static com.vaadin.flow.component.charts.model.Configuration parse(String configJson)
      Parses a Highcharts JSON configuration string into a new Configuration object.
      Parameters:
      configJson - the Highcharts JSON configuration string to parse
      Returns:
      a new Configuration populated with the parsed values
      Throws:
      IllegalArgumentException - if the JSON string is invalid or not an object
    • merge

      public static void merge(String configJson, com.vaadin.flow.component.charts.model.Configuration config)
      Parses a JSON configuration string and applies the values onto the given Configuration. Only properties present in the JSON are modified; existing properties not mentioned in the JSON are preserved.
      Parameters:
      configJson - the Highcharts JSON configuration string to parse
      config - the existing Configuration to merge the parsed values into
      Throws:
      IllegalArgumentException - if the JSON string is invalid or not an object