Class Chart
- All Implemented Interfaces:
com.vaadin.flow.component.AttachNotifier,com.vaadin.flow.component.DetachNotifier,com.vaadin.flow.component.HasElement,com.vaadin.flow.component.HasSize,com.vaadin.flow.component.HasStyle,com.vaadin.flow.component.HasTheme,Serializable
The Chart is a regular Vaadin component, which you can add to any Vaadin layout.
- Author:
- Vaadin Ltd
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.vaadin.flow.shared.RegistrationaddChartAddSeriesListener(com.vaadin.flow.component.ComponentEventListener<ChartAddSeriesEvent> listener) Adds a chart add series listener, which will be notified after a new series is added to the chartcom.vaadin.flow.shared.RegistrationaddChartAfterPrintListener(com.vaadin.flow.component.ComponentEventListener<ChartAfterPrintEvent> listener) Adds a chart after print listener, which will be notified after the chart is printed using the print menucom.vaadin.flow.shared.RegistrationaddChartBeforePrintListener(com.vaadin.flow.component.ComponentEventListener<ChartBeforePrintEvent> listener) Adds a chart before print listener, which will be notified before the chart is printed using the print menucom.vaadin.flow.shared.RegistrationaddChartClickListener(com.vaadin.flow.component.ComponentEventListener<ChartClickEvent> listener) Adds chart click listener, which will be notified of clicks on the chart areacom.vaadin.flow.shared.RegistrationaddChartDrillupAllListener(com.vaadin.flow.component.ComponentEventListener<ChartDrillupAllEvent> listener) Adds chart drillupall listener, which will be notified after all the series have been drilled up in a chart with multiple drilldown series.com.vaadin.flow.shared.RegistrationaddChartDrillupListener(com.vaadin.flow.component.ComponentEventListener<ChartDrillupEvent> listener) Adds chart drillup listener, which will be notified of clicks on the 'Back to previous series' button.com.vaadin.flow.shared.RegistrationaddChartLoadListener(com.vaadin.flow.component.ComponentEventListener<ChartLoadEvent> listener) Adds a chart load listener, which will be notified after a chart is loadedcom.vaadin.flow.shared.RegistrationaddChartRedrawListener(com.vaadin.flow.component.ComponentEventListener<ChartRedrawEvent> listener) Adds a chart redraw listener, which will be notified after a chart is redrawncom.vaadin.flow.shared.RegistrationaddChartSelectionListener(com.vaadin.flow.component.ComponentEventListener<ChartSelectionEvent> listener) Adds a chart selection listenercom.vaadin.flow.shared.RegistrationaddCheckBoxClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesCheckboxClickEvent> listener) Adds checkbox click listener, which will be notified when user has clicked a checkbox in the legendcom.vaadin.flow.shared.RegistrationaddDrilldownListener(com.vaadin.flow.component.ComponentEventListener<DrilldownEvent> listener) Sets the Chart drilldown handler that's responsible for returning the drilldown series for each drilldown callback when doing async drilldowncom.vaadin.flow.shared.RegistrationaddPointClickListener(com.vaadin.flow.component.ComponentEventListener<PointClickEvent> listener) Adds a point click listener, which will be notified of clicks on the points, bars or columns in the chartcom.vaadin.flow.shared.RegistrationaddPointDragListener(com.vaadin.flow.component.ComponentEventListener<PointDragEvent> listener) Adds a point drag listener, which will be notified while point is dragged.com.vaadin.flow.shared.RegistrationaddPointDragStartListener(com.vaadin.flow.component.ComponentEventListener<PointDragStartEvent> listener) Adds a point drag start listener, which will be notified when starting to drag a point.com.vaadin.flow.shared.RegistrationaddPointDropListener(com.vaadin.flow.component.ComponentEventListener<PointDropEvent> listener) Adds a point drop listener, which will be notified point is dropped.com.vaadin.flow.shared.RegistrationaddPointLegendItemClickListener(com.vaadin.flow.component.ComponentEventListener<PointLegendItemClickEvent> listener) Adds a point legend item click listener, which will be notified of clicks on the legend's items corresponding to a Pointcom.vaadin.flow.shared.RegistrationaddPointMouseOutListener(com.vaadin.flow.component.ComponentEventListener<PointMouseOutEvent> listener) Adds a point mouse out listener, which will be notified when the mouse exits the neighborhood of a data pointcom.vaadin.flow.shared.RegistrationaddPointMouseOverListener(com.vaadin.flow.component.ComponentEventListener<PointMouseOverEvent> listener) Adds a point mouse over listener, which will be notified when the mouse enters the neighborhood of a data pointcom.vaadin.flow.shared.RegistrationaddPointRemoveListener(com.vaadin.flow.component.ComponentEventListener<PointRemoveEvent> listener) Adds a point remove listener, which will be notified when a data point is removed.com.vaadin.flow.shared.RegistrationaddPointSelectListener(com.vaadin.flow.component.ComponentEventListener<PointSelectEvent> listener) Adds a point select listener, which will be notified when a data point is selected.com.vaadin.flow.shared.RegistrationaddPointUnselectListener(com.vaadin.flow.component.ComponentEventListener<PointUnselectEvent> listener) Adds a point unselect listener, which will be notified when a data point is unselected.com.vaadin.flow.shared.RegistrationaddPointUpdateListener(com.vaadin.flow.component.ComponentEventListener<PointUpdateEvent> listener) Adds a point update listener, which will be notified when a data point is updated.com.vaadin.flow.shared.RegistrationaddSeriesAfterAnimateListener(com.vaadin.flow.component.ComponentEventListener<SeriesAfterAnimateEvent> listener) Adds a series after animate listener, which will be notified after a series is animatedcom.vaadin.flow.shared.RegistrationaddSeriesClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesClickEvent> listener) Adds a series click listener, which will be notified of clicks on the series in the chartcom.vaadin.flow.shared.RegistrationaddSeriesHideListener(com.vaadin.flow.component.ComponentEventListener<SeriesHideEvent> listener) Adds a series hide listener, which will be notified when a series is hiddencom.vaadin.flow.shared.RegistrationaddSeriesLegendItemClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesLegendItemClickEvent> listener) Adds a series legend item click listener, which will be notified of clicks on the legend's items corresponding to a Seriescom.vaadin.flow.shared.RegistrationaddSeriesMouseOutListener(com.vaadin.flow.component.ComponentEventListener<SeriesMouseOutEvent> listener) Adds a point mouse out listener, which will be notified when the mouse exits the neighborhood of a seriescom.vaadin.flow.shared.RegistrationaddSeriesMouseOverListener(com.vaadin.flow.component.ComponentEventListener<SeriesMouseOverEvent> listener) Adds a point mouse out listener, which will be notified when the mouse enters the neighborhood of a seriescom.vaadin.flow.shared.RegistrationaddSeriesShowListener(com.vaadin.flow.component.ComponentEventListener<SeriesShowEvent> listener) Adds a series show listener, which will be notified when a series is shownvoidaddThemeVariants(ChartVariant... variants) Adds theme variants to the component.com.vaadin.flow.shared.RegistrationaddXAxesExtremesSetListener(com.vaadin.flow.component.ComponentEventListener<XAxesExtremesSetEvent> listener) Adds a x axes extremes set listener, which will be notified when an x axis extremes are setcom.vaadin.flow.shared.RegistrationaddYAxesExtremesSetListener(com.vaadin.flow.component.ComponentEventListener<YAxesExtremesSetEvent> listener) Adds a y axes extremes set listener, which will be notified when an y axis extremes are setvoidDraws a chart using the current configuration.voiddrawChart(boolean resetConfiguration) Draws a chart using the current configuration.protected voidonAttach(com.vaadin.flow.component.AttachEvent attachEvent) voidremoveThemeVariants(ChartVariant... variants) Removes theme variants from the component.voidsetConfiguration(Configuration configuration) voidsetDrilldownCallback(DrilldownCallback drilldownCallback) voidsetTimeline(Boolean timeline) Determines if the chart is in timeline mode or in normal mode.voidsetVisibilityTogglingDisabled(boolean disabled) The series or point visibility is toggled by default if user clicks the legend item that corresponds to the series or point.Methods inherited from class com.vaadin.flow.component.Component
addListener, findAncestor, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getListeners, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, removeFromParent, scrollIntoView, scrollIntoView, set, setElement, setId, setVisibleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.vaadin.flow.component.AttachNotifier
addAttachListenerMethods inherited from interface com.vaadin.flow.component.DetachNotifier
addDetachListenerMethods inherited from interface com.vaadin.flow.component.HasElement
getElementMethods inherited from interface com.vaadin.flow.component.HasSize
getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFullMethods inherited from interface com.vaadin.flow.component.HasStyle
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassNameMethods inherited from interface com.vaadin.flow.component.HasTheme
addThemeName, addThemeNames, getThemeName, getThemeNames, hasThemeName, removeThemeName, removeThemeNames, setThemeName, setThemeName
-
Constructor Details
-
Chart
public Chart()Creates a new chart with default configuration -
Chart
Creates a new chart with the given type- Parameters:
type-- See Also:
-
-
Method Details
-
onAttach
protected void onAttach(com.vaadin.flow.component.AttachEvent attachEvent) - Overrides:
onAttachin classcom.vaadin.flow.component.Component
-
drawChart
public void drawChart()Draws a chart using the current configuration.- See Also:
-
drawChart
public void drawChart(boolean resetConfiguration) Draws a chart using the current configuration.The chart takes the current configuration from
getConfiguration().Note that if you modify the underlying
Seriesdirectly, the chart will automatically be updated.Note that you don't need to call this method if
Configurationis ready before element is attached.- Parameters:
resetConfiguration- defines whether the chart should be redrawn or not- See Also:
-
setTimeline
Determines if the chart is in timeline mode or in normal mode. The following chart types do not support timeline mode:- ChartType.PIE
- ChartType.GAUGE
- ChartType.SOLIDGAUGE
- ChartType.PYRAMID
- ChartType.FUNNEL
- ChartType.ORGANIZATION
- ChartType.GANTT
IllegalArgumentExceptionNote: for Timeline chart type see
ChartType.TIMELINEandPlotOptionsTimeline.- Parameters:
timeline- true for timeline chart
-
setVisibilityTogglingDisabled
public void setVisibilityTogglingDisabled(boolean disabled) The series or point visibility is toggled by default if user clicks the legend item that corresponds to the series or point. Calling setVisibilityTogglingDisabled(true) will disable this behavior.- Parameters:
disabled-
-
getConfiguration
- Returns:
- the chart configuration that is used for this chart
-
setConfiguration
- Parameters:
configuration- new configuration for this chart.
-
getDrilldownCallback
-
setDrilldownCallback
-
addChartAddSeriesListener
public com.vaadin.flow.shared.Registration addChartAddSeriesListener(com.vaadin.flow.component.ComponentEventListener<ChartAddSeriesEvent> listener) Adds a chart add series listener, which will be notified after a new series is added to the chart- Parameters:
listener-
-
addChartAfterPrintListener
public com.vaadin.flow.shared.Registration addChartAfterPrintListener(com.vaadin.flow.component.ComponentEventListener<ChartAfterPrintEvent> listener) Adds a chart after print listener, which will be notified after the chart is printed using the print menu- Parameters:
listener-
-
addChartBeforePrintListener
public com.vaadin.flow.shared.Registration addChartBeforePrintListener(com.vaadin.flow.component.ComponentEventListener<ChartBeforePrintEvent> listener) Adds a chart before print listener, which will be notified before the chart is printed using the print menu- Parameters:
listener-
-
addChartClickListener
public com.vaadin.flow.shared.Registration addChartClickListener(com.vaadin.flow.component.ComponentEventListener<ChartClickEvent> listener) Adds chart click listener, which will be notified of clicks on the chart area- Parameters:
listener-
-
addChartDrillupListener
public com.vaadin.flow.shared.Registration addChartDrillupListener(com.vaadin.flow.component.ComponentEventListener<ChartDrillupEvent> listener) Adds chart drillup listener, which will be notified of clicks on the 'Back to previous series' button.- Parameters:
listener-
-
addChartDrillupAllListener
public com.vaadin.flow.shared.Registration addChartDrillupAllListener(com.vaadin.flow.component.ComponentEventListener<ChartDrillupAllEvent> listener) Adds chart drillupall listener, which will be notified after all the series have been drilled up in a chart with multiple drilldown series.- Parameters:
listener-
-
addChartLoadListener
public com.vaadin.flow.shared.Registration addChartLoadListener(com.vaadin.flow.component.ComponentEventListener<ChartLoadEvent> listener) Adds a chart load listener, which will be notified after a chart is loaded- Parameters:
listener-
-
addChartRedrawListener
public com.vaadin.flow.shared.Registration addChartRedrawListener(com.vaadin.flow.component.ComponentEventListener<ChartRedrawEvent> listener) Adds a chart redraw listener, which will be notified after a chart is redrawn- Parameters:
listener-
-
addCheckBoxClickListener
public com.vaadin.flow.shared.Registration addCheckBoxClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesCheckboxClickEvent> listener) Adds checkbox click listener, which will be notified when user has clicked a checkbox in the legend- Parameters:
listener-
-
addDrilldownListener
public com.vaadin.flow.shared.Registration addDrilldownListener(com.vaadin.flow.component.ComponentEventListener<DrilldownEvent> listener) Sets the Chart drilldown handler that's responsible for returning the drilldown series for each drilldown callback when doing async drilldown- Parameters:
listener-- See Also:
-
addChartSelectionListener
public com.vaadin.flow.shared.Registration addChartSelectionListener(com.vaadin.flow.component.ComponentEventListener<ChartSelectionEvent> listener) Adds a chart selection listenerNote that if a chart selection listener is set, default action for selection is prevented. Most commonly this means that client side zoom doesn't work and you are responsible for setting the zoom, etc in the listener implementation.
- Parameters:
listener-
-
addSeriesLegendItemClickListener
public com.vaadin.flow.shared.Registration addSeriesLegendItemClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesLegendItemClickEvent> listener) Adds a series legend item click listener, which will be notified of clicks on the legend's items corresponding to a SeriesNote that by default, clicking on a legend item toggles the visibility of its associated series. To disable this behavior call setVisibilityTogglingDisabled(
true)- Parameters:
listener-- See Also:
-
addPointLegendItemClickListener
public com.vaadin.flow.shared.Registration addPointLegendItemClickListener(com.vaadin.flow.component.ComponentEventListener<PointLegendItemClickEvent> listener) Adds a point legend item click listener, which will be notified of clicks on the legend's items corresponding to a PointNote that by default, clicking on a legend item toggles the visibility of its associated point. To disable this behavior call setVisibilityTogglingDisabled(
true)- Parameters:
listener-- See Also:
-
addSeriesAfterAnimateListener
public com.vaadin.flow.shared.Registration addSeriesAfterAnimateListener(com.vaadin.flow.component.ComponentEventListener<SeriesAfterAnimateEvent> listener) Adds a series after animate listener, which will be notified after a series is animated- Parameters:
listener-
-
addSeriesClickListener
public com.vaadin.flow.shared.Registration addSeriesClickListener(com.vaadin.flow.component.ComponentEventListener<SeriesClickEvent> listener) Adds a series click listener, which will be notified of clicks on the series in the chart- Parameters:
listener-
-
addSeriesHideListener
public com.vaadin.flow.shared.Registration addSeriesHideListener(com.vaadin.flow.component.ComponentEventListener<SeriesHideEvent> listener) Adds a series hide listener, which will be notified when a series is hidden- Parameters:
listener-
-
addSeriesMouseOutListener
public com.vaadin.flow.shared.Registration addSeriesMouseOutListener(com.vaadin.flow.component.ComponentEventListener<SeriesMouseOutEvent> listener) Adds a point mouse out listener, which will be notified when the mouse exits the neighborhood of a series- Parameters:
listener-
-
addSeriesMouseOverListener
public com.vaadin.flow.shared.Registration addSeriesMouseOverListener(com.vaadin.flow.component.ComponentEventListener<SeriesMouseOverEvent> listener) Adds a point mouse out listener, which will be notified when the mouse enters the neighborhood of a series- Parameters:
listener-
-
addSeriesShowListener
public com.vaadin.flow.shared.Registration addSeriesShowListener(com.vaadin.flow.component.ComponentEventListener<SeriesShowEvent> listener) Adds a series show listener, which will be notified when a series is shown- Parameters:
listener-
-
addPointClickListener
public com.vaadin.flow.shared.Registration addPointClickListener(com.vaadin.flow.component.ComponentEventListener<PointClickEvent> listener) Adds a point click listener, which will be notified of clicks on the points, bars or columns in the chart- Parameters:
listener-
-
addPointMouseOutListener
public com.vaadin.flow.shared.Registration addPointMouseOutListener(com.vaadin.flow.component.ComponentEventListener<PointMouseOutEvent> listener) Adds a point mouse out listener, which will be notified when the mouse exits the neighborhood of a data point- Parameters:
listener-
-
addPointMouseOverListener
public com.vaadin.flow.shared.Registration addPointMouseOverListener(com.vaadin.flow.component.ComponentEventListener<PointMouseOverEvent> listener) Adds a point mouse over listener, which will be notified when the mouse enters the neighborhood of a data point- Parameters:
listener-
-
addPointRemoveListener
public com.vaadin.flow.shared.Registration addPointRemoveListener(com.vaadin.flow.component.ComponentEventListener<PointRemoveEvent> listener) Adds a point remove listener, which will be notified when a data point is removed.- Parameters:
listener-
-
addPointSelectListener
public com.vaadin.flow.shared.Registration addPointSelectListener(com.vaadin.flow.component.ComponentEventListener<PointSelectEvent> listener) Adds a point select listener, which will be notified when a data point is selected.- Parameters:
listener-
-
addPointUnselectListener
public com.vaadin.flow.shared.Registration addPointUnselectListener(com.vaadin.flow.component.ComponentEventListener<PointUnselectEvent> listener) Adds a point unselect listener, which will be notified when a data point is unselected.- Parameters:
listener-
-
addPointUpdateListener
public com.vaadin.flow.shared.Registration addPointUpdateListener(com.vaadin.flow.component.ComponentEventListener<PointUpdateEvent> listener) Adds a point update listener, which will be notified when a data point is updated.- Parameters:
listener-
-
addPointDragStartListener
public com.vaadin.flow.shared.Registration addPointDragStartListener(com.vaadin.flow.component.ComponentEventListener<PointDragStartEvent> listener) Adds a point drag start listener, which will be notified when starting to drag a point.- Parameters:
listener-
-
addPointDropListener
public com.vaadin.flow.shared.Registration addPointDropListener(com.vaadin.flow.component.ComponentEventListener<PointDropEvent> listener) Adds a point drop listener, which will be notified point is dropped.- Parameters:
listener-
-
addPointDragListener
public com.vaadin.flow.shared.Registration addPointDragListener(com.vaadin.flow.component.ComponentEventListener<PointDragEvent> listener) Adds a point drag listener, which will be notified while point is dragged.- Parameters:
listener-
-
addXAxesExtremesSetListener
public com.vaadin.flow.shared.Registration addXAxesExtremesSetListener(com.vaadin.flow.component.ComponentEventListener<XAxesExtremesSetEvent> listener) Adds a x axes extremes set listener, which will be notified when an x axis extremes are set- Parameters:
listener-
-
addYAxesExtremesSetListener
public com.vaadin.flow.shared.Registration addYAxesExtremesSetListener(com.vaadin.flow.component.ComponentEventListener<YAxesExtremesSetEvent> listener) Adds a y axes extremes set listener, which will be notified when an y axis extremes are set- Parameters:
listener-
-
addThemeVariants
Adds theme variants to the component.- Parameters:
variants- theme variants to add
-
removeThemeVariants
Removes theme variants from the component.- Parameters:
variants- theme variants to remove
-