Package com.vaadin.flow.component.charts
Class ChartOptions
- java.lang.Object
-
- com.vaadin.flow.component.charts.model.AbstractConfigurationObject
-
- com.vaadin.flow.component.charts.ChartOptions
-
- All Implemented Interfaces:
Serializable
public class ChartOptions extends AbstractConfigurationObject
The ChartOptions configures a page local global options like localized texts for charts.Use
get()orget(UI)to get an instance for the current or specifiedUI.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedChartOptions()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ChartOptionsget()Returns a ChartOptions instance for the current UI.static ChartOptionsget(com.vaadin.flow.component.UI ui)Returns a ChartOptions instance for the given UI.LanggetLang()Returns theLangin use ornullif no lang configuration has been set.ThemegetTheme()Returns theThemein use ornullif no theme has been set.voidsetLang(Lang lang)Changes the language of all charts.voidsetTheme(Theme theme)Sets the theme to use.
-
-
-
Method Detail
-
setLang
public void setLang(Lang lang)
Changes the language of all charts.- Parameters:
lang-
-
getLang
public Lang getLang()
Returns theLangin use ornullif no lang configuration has been set.- Returns:
- the
Langin use ornull.
-
getTheme
public Theme getTheme()
Returns theThemein use ornullif no theme has been set.- Returns:
- the
Themein use ornull.
-
setTheme
public void setTheme(Theme theme)
Sets the theme to use. Note that if the view is already drawn, all existingCharts will be redrawn.- Parameters:
theme-
-
get
public static ChartOptions get(com.vaadin.flow.component.UI ui)
Returns a ChartOptions instance for the given UI. If a ChartOptions extension has not yet been added, a new one is created and added.- Parameters:
ui- the UI for which the ChartOptions should be returned, notnull- Returns:
- the ChartOptions instance connected to the given UI
-
get
public static ChartOptions get()
Returns a ChartOptions instance for the current UI. If a ChartOptions extension has not yet been added, a new one is created and added.- Returns:
- a ChartOptions instance connected to the currently active UI
-
-