Class Configuration
java.lang.Object
com.vaadin.flow.component.charts.model.AbstractConfigurationObject
com.vaadin.flow.component.charts.model.Configuration
- All Implemented Interfaces:
ChartConfiguration
,Serializable
Chart's configuration root object containing all the child objects that are
used to configure chart, axes, legend, titles etc.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ConfigurationChangeListener listener) Sets the listener to be notified of e.g.void
addColorAxis
(ColorAxis axis) Adds a color-axis to the configurationvoid
addLabel
(AnnotationItemLabel label) Adds a single labelvoid
Adds a pane.void
addPlotOptions
(AbstractPlotOptions plotOptions) Adds plot optionsvoid
Adds a single series to the list of series in this configuration.void
Adds an X-axis to the configurationvoid
Adds a Y-axis.void
Adds a Z-axis.void
Disables the credits by setting a Credits object with the enabled property set to false.void
fireAxesRescaled
(Axis axis, Number minimum, Number maximum, boolean redraw, boolean animate) Fires axis rescaled event.getChart()
Returns the color axis.getColorAxis
(int index) Configuration options for drill down, the concept of inspecting increasingly high resolution data through clicking on chart items like columns or pie slices.int
int
int
int
getPane()
Returns all plot options used by this configuration.getPlotOptions
(ChartType type) Returns the plot options for a specific chart type used by this configuration.getTime()
getTitle()
getxAxis()
Returns the X-axis or category axis.getxAxis
(int index) getyAxes()
getyAxis()
Returns the Y-axis or value axis.getyAxis
(int index) getzAxes()
getzAxis()
Returns the Z-axis.getzAxis
(int index) void
Removes a change listener.void
Removes all defined color-axesvoid
Removes all defined X-axesvoid
Removes all defined Y-axesvoid
Removes all defined Z-axesvoid
Reset zoom level by setting axes extremes to nullvoid
resetZoom
(boolean redraw, boolean animate) Reset zoom level by setting axes extremes to nullvoid
Reverses the ListSeries (transposes it such that categories would be series names and vice versa) to help stacking throwsIllegalStateException
if series are not ListSeries typevoid
setAccessibility
(Accessibility accessibility) Sets options for configuring accessibility for the chart.void
setChart
(ChartModel chart) Sets options regarding the chart and plot areas as well as general chart options.void
setCredits
(Credits credits) Sets/changes the credits label that is added in the lower right corner of the chart.void
setExporting
(Exporting exporting) Sets the exporting module settings.void
setExporting
(Boolean exporting) Sets whether to enable exportingvoid
setLabels
(AnnotationItemLabel... labels) Sets labels that can be positioned anywhere in the chart areavoid
Sets the legend.void
setLoading
(Loading loading) Set loading options control the appearance of the loading screen that covers the plot area on chart operations.void
setNavigation
(Navigation navigation) Set options for buttons and menus appearing in the exporting module.void
setNavigator
(Navigator navigator) Set configuration for the navigatorvoid
Set options for displaying a message when no data is available.void
setPlotOptions
(AbstractPlotOptions... plotOptions) Sets component-wide default plot options.void
setRangeSelector
(RangeSelector rangeSelector) Set settings for range selector.void
setScrollbar
(Scrollbar scrollbar) Set configuration for the scrollbar.void
void
Sets the actual series to append to the chart.void
setSubTitle
(Subtitle subTitle) Sets the chart's subtitlevoid
setSubTitle
(String text) Sets the subtitle to the given textvoid
Set configuration for time optionsvoid
The main title of the chart.void
Sets the new chart's main title to the given stringvoid
setTooltip
(Tooltip tooltip) Sets the options for the tooltip that appears when the user hovers over a series or point.
-
Constructor Details
-
Configuration
public Configuration()
-
-
Method Details
-
getAccessibility
- See Also:
-
setAccessibility
Sets options for configuring accessibility for the chart.- Parameters:
accessibility
-
-
getChart
- See Also:
-
setChart
Sets options regarding the chart and plot areas as well as general chart options.- Parameters:
chart
- ChartModel to set, notnull
-
getSeries
- See Also:
-
addSeries
Adds a single series to the list of series in this configuration.- Parameters:
series
-
-
setSeries
Sets the actual series to append to the chart. Series objects contains the data content (individual points/columns etc.) of the plot. The series object could have data (the content), name, labels, tooltips, markers etc.
In addition to the attributes listed above, any member of the plotOptions for that specific type of plot can be added to a series individually. For example, even though a general lineWidth is specified in AbstractPlotOptions, an individual lineWidth can be specified for each series (e.g. to enable each series have different lineWidth).
If the chart is already rendered on the client,Chart.drawChart(boolean)
needs to be called withtrue
as parameter so the configuration object is resent to the client.- Parameters:
series
-
-
setSeries
- Parameters:
series
-- See Also:
-
getDrilldown
Configuration options for drill down, the concept of inspecting increasingly high resolution data through clicking on chart items like columns or pie slices.- Returns:
- current drilldown configuration
-
getTitle
- See Also:
-
setTitle
The main title of the chart.- Parameters:
title
-
-
setTitle
Sets the new chart's main title to the given string- Parameters:
text
- Text of title
-
getSubTitle
- Returns:
- The chart's subtitle
-
setSubTitle
Sets the subtitle to the given text- Parameters:
text
- Text of subtitle
-
setSubTitle
Sets the chart's subtitle- Parameters:
subTitle
-
-
getxAxis
Returns the X-axis or category axis. Normally this is the horizontal axis, though if the chart is inverted this is the vertical axis. In case of multiple axes defined, the first axis is returned. An axis will be created if no axis is defined.- Returns:
- the X-axis or category axis.
-
getNumberOfxAxes
public int getNumberOfxAxes()- Returns:
- the number of X-axes defined
-
getxAxis
- Returns:
- The X-axis with the given index or null if the index is not valid
-
removexAxes
public void removexAxes()Removes all defined X-axes -
addxAxis
Adds an X-axis to the configuration- Parameters:
axis
- The X-Axis to add.- See Also:
-
getyAxis
Returns the Y-axis or value axis. Normally this is the vertical axis, though if the chart is inverted this is the horizontal axis. In case there are multiple axes defined (a list), only the first axis is returned. If none exist, a Y-axis will be created.- Returns:
- The first Y-axis
- See Also:
-
getNumberOfyAxes
public int getNumberOfyAxes()- Returns:
- The number of Y-axes defined
-
getyAxis
- Returns:
- The Y-axis with the given index or null if the index is not valid
-
removeyAxes
public void removeyAxes()Removes all defined Y-axes -
addyAxis
Adds a Y-axis.- Parameters:
axis
- The Y-axis to add.- See Also:
-
getyAxes
- Returns:
- A list of all defined Y-axes, null if none are found.
-
getzAxis
Returns the Z-axis. In case there are multiple axes defined (a list), only the first axis is returned. If none exist, a Z-axis will be created.- Returns:
- The first Z-axis
- See Also:
-
getNumberOfzAxes
public int getNumberOfzAxes()- Returns:
- The number of Z-axes defined
-
getzAxis
- Returns:
- The Z-axis with the given index or null if the index is not valid
-
removezAxes
public void removezAxes()Removes all defined Z-axes -
addzAxis
Adds a Z-axis.- Parameters:
axis
- The Z-axis to add.- See Also:
-
getzAxes
- Returns:
- A list of all defined Z-axes, null if none are found.
-
getTooltip
- Returns:
- the tooltip options for this chart. If none have been set, a new Tooltip object with the default options is created.
- See Also:
-
setTooltip
Sets the options for the tooltip that appears when the user hovers over a series or point.- Parameters:
tooltip
-
-
getCredits
- See Also:
-
setCredits
Sets/changes the credits label that is added in the lower right corner of the chart.- Parameters:
credits
-
-
disableCredits
public void disableCredits()Disables the credits by setting a Credits object with the enabled property set to false. -
getLegend
- See Also:
-
setLegend
Sets the legend. The legend is a box containing a symbol and name for each series item or point item in the chart.- Parameters:
legend
-
-
getPlotOptions
Returns all plot options used by this configuration.- See Also:
-
getPlotOptions
Returns the plot options for a specific chart type used by this configuration.Returns null if no plot options was found for the type
- Parameters:
type
-- See Also:
-
setPlotOptions
Sets component-wide default plot options.If the component contains several chart types, this method can be called with several plot option types. Subsequent calls with the same plot type will replace previous options for that specific chart type i.e only the latest options for each chart type is honored.
PlotOptionsSeries
is a special plot options type that can be used to define rules for all chart types.- Parameters:
plotOptions
-- See Also:
-
addPlotOptions
Adds plot options- Parameters:
plotOptions
-- See Also:
-
setExporting
Sets whether to enable exporting- Parameters:
exporting
-- See Also:
-
setExporting
Sets the exporting module settings.- Parameters:
exporting
-- See Also:
-
getExporting
- See Also:
-
isExporting
- See Also:
-
getPane
- See Also:
-
addPane
Adds a pane. This applies only to polar charts and angular gauges. This configuration object holds general options for the combined X and Y -axes set. Each XAxis or YAxis can reference the pane by index.- Parameters:
pane
-
-
setRangeSelector
Set settings for range selector.This is only valid if the chart is configured to use timeline. See
Chart.setTimeline(Boolean)
}- Parameters:
rangeSelector
-- See Also:
-
getRangeSelector
-
getScrollbar
- See Also:
-
setScrollbar
Set configuration for the scrollbar. Allows panning over the X axis of the chart- Parameters:
scrollbar
-
-
getNoData
- See Also:
-
setNoData
Set options for displaying a message when no data is available. The actual text to display is set in theLang.setNoData(String)
- Parameters:
noData
-
-
getLoading
- See Also:
-
setLoading
Set loading options control the appearance of the loading screen that covers the plot area on chart operations.- Parameters:
loading
-
-
getTime
- See Also:
-
setTime
Set configuration for time options- Parameters:
time
-
-
reverseListSeries
public void reverseListSeries()Reverses the ListSeries (transposes it such that categories would be series names and vice versa) to help stacking throwsIllegalStateException
if series are not ListSeries type -
fireAxesRescaled
public void fireAxesRescaled(Axis axis, Number minimum, Number maximum, boolean redraw, boolean animate) Fires axis rescaled event.- Specified by:
fireAxesRescaled
in interfaceChartConfiguration
- Parameters:
axis
- Axis that is the source of the event.minimum
- New minimum.maximum
- New maximum.redraw
- Whether or not to redraw.animate
- Whether or not to animate.
-
resetZoom
public void resetZoom()Reset zoom level by setting axes extremes to null -
resetZoom
public void resetZoom(boolean redraw, boolean animate) Reset zoom level by setting axes extremes to null- Parameters:
redraw
- Whether or not to redraw.animate
- Whether or not to animate.
-
addChangeListener
Sets the listener to be notified of e.g. data series changesThis method is used internally by the library. Usage by the end user will cause unexpected behavior.
- Parameters:
listener
- Listener to add.
-
removeChangeListener
Removes a change listener.- Parameters:
listener
- Listener to remove.
-
getColorAxis
Returns the color axis. This is used in color-based diagrams, like heat maps. In case of multiple axes defined, the first axis is returned. An axis will be created if no axis is defined.- Returns:
- the color axis.
-
getNumberOfColorAxes
public int getNumberOfColorAxes()- Returns:
- the number of color axes defined
-
getColorAxis
- Returns:
- The Color-axis with the given index or null if the index is not valid
-
removeColorAxes
public void removeColorAxes()Removes all defined color-axes -
addColorAxis
Adds a color-axis to the configuration- Parameters:
axis
- The color Axis to add.- See Also:
-
getLabels
- Returns:
- Labels
- See Also:
-
setLabels
Sets labels that can be positioned anywhere in the chart area- Parameters:
labels
- The labels to set
-
addLabel
Adds a single label- Parameters:
label
- The label to add- See Also:
-