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 Details

    • parse

      public static 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, 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