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:
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:
-
-
Constructor Summary
Constructors Modifier Constructor and Description protected
ChartOptions()
-
Method Summary
All Methods Modifier and Type Method and Description static ChartOptions
get()
Returns a ChartOptions instance for the current UI.
static ChartOptions
get(UI ui)
Returns a ChartOptions instance for the given UI.
Lang
getLang()
Returns the
Lang
in use ornull
if no lang configuration has been set.Theme
getTheme()
Returns the
Theme
in use ornull
if no theme has been set.void
setLang(Lang lang)
Changes the language of all charts.
void
setTheme(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 the
Lang
in use ornull
if no lang configuration has been set.Returns:
the
Lang
in use ornull
.
-
getTheme
public Theme getTheme()
Returns the
Theme
in use ornull
if no theme has been set.Returns:
the
Theme
in use ornull
.
-
setTheme
public void setTheme(Theme theme)
Sets the theme to use.
Note that if the view is already drawn, all existing
Chart
s will be redrawn.Parameters:
theme
-
-
get
public static ChartOptions get(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
-
-