Class ChartConfigurationParser
java.lang.Object
com.vaadin.flow.component.ai.chart.ChartConfigurationParser
- All Implemented Interfaces:
Serializable
Parses a Highcharts JSON configuration string into a Vaadin
Configuration object.- Author:
- Vaadin Ltd
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidmerge(String configJson, Configuration config) Parses a JSON configuration string and applies the values onto the givenConfiguration.static ConfigurationParses a Highcharts JSON configuration string into a newConfigurationobject.
-
Method Details
-
parse
Parses a Highcharts JSON configuration string into a newConfigurationobject.- Parameters:
configJson- the Highcharts JSON configuration string to parse- Returns:
- a new
Configurationpopulated with the parsed values - Throws:
IllegalArgumentException- if the JSON string is invalid or not an object
-
merge
Parses a JSON configuration string and applies the values onto the givenConfiguration. 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 parseconfig- the existingConfigurationto merge the parsed values into- Throws:
IllegalArgumentException- if the JSON string is invalid or not an object
-