com.vaadin.flow.component.charts.

Class 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() or get(UI) to get an instance for the current or specified UI.

See Also:

  • Constructor Details

    • ChartOptions

      protected ChartOptions()
  • Method Details

    • setLang

      public void setLang(Lang lang)

      Changes the language of all charts.

      Parameters:

      lang -

    • getLang

      public Lang getLang()

      Returns the Lang in use or null if no lang configuration has been set.

      Returns:

      the Lang in use or null.

    • getTheme

      public Theme getTheme()

      Returns the Theme in use or null if no theme has been set.

      Returns:

      the Theme in use or null.

    • setTheme

      public void setTheme(Theme theme)

      Sets the theme to use.

      Note that if the view is already drawn, all existing Charts 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, not null

      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