@Tag(value="vaadin-chart") @NpmPackage(value="@vaadin/vaadin-charts", version="6.3.8") @JsModule(value="@vaadin/vaadin-charts/vaadin-chart.js") public class Chart extends Component implements HasStyle, HasSize
Constructor and Description |
---|
Chart()
Creates a new chart with default configuration
|
Chart(ChartType type)
Creates a new chart with the given type
|
Modifier and Type | Method and Description |
---|---|
Registration |
addChartAddSeriesListener(ComponentEventListener<ChartAddSeriesEvent> listener)
Adds a chart add series listener, which will be notified after a new
series is added to the chart
|
Registration |
addChartAfterPrintListener(ComponentEventListener<ChartAfterPrintEvent> listener)
Adds a chart after print listener, which will be notified after the chart
is printed using the print menu
|
Registration |
addChartBeforePrintListener(ComponentEventListener<ChartBeforePrintEvent> listener)
Adds a chart before print listener, which will be notified before the
chart is printed using the print menu
|
Registration |
addChartClickListener(ComponentEventListener<ChartClickEvent> listener)
Adds chart click listener, which will be notified of clicks on the chart
area
|
Registration |
addChartDrillupAllListener(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.
|
Registration |
addChartDrillupListener(ComponentEventListener<ChartDrillupEvent> listener)
Adds chart drillup listener, which will be notified of clicks on the
'Back to previous series' button.
|
Registration |
addChartLoadListener(ComponentEventListener<ChartLoadEvent> listener)
Adds a chart load listener, which will be notified after a chart is
loaded
|
Registration |
addChartRedrawListener(ComponentEventListener<ChartRedrawEvent> listener)
Adds a chart redraw listener, which will be notified after a chart is
redrawn
|
Registration |
addChartSelectionListener(ComponentEventListener<ChartSelectionEvent> listener)
Adds a chart selection listener
|
Registration |
addCheckBoxClickListener(ComponentEventListener<SeriesCheckboxClickEvent> listener)
Adds checkbox click listener, which will be notified when user has
clicked a checkbox in the legend
|
Registration |
addDrilldownListener(ComponentEventListener<DrilldownEvent> listener)
Sets the Chart drilldown handler that's responsible for returning the
drilldown series for each drilldown callback when doing async drilldown
|
Registration |
addPointClickListener(ComponentEventListener<PointClickEvent> listener)
Adds a point click listener, which will be notified of clicks on the
points, bars or columns in the chart
|
Registration |
addPointLegendItemClickListener(ComponentEventListener<PointLegendItemClickEvent> listener)
Adds a point legend item click listener, which will be notified of clicks
on the legend's items corresponding to a Point
|
Registration |
addPointMouseOutListener(ComponentEventListener<PointMouseOutEvent> listener)
Adds a point mouse out listener, which will be notified when the mouse
exits the neighborhood of a data point
|
Registration |
addPointMouseOverListener(ComponentEventListener<PointMouseOverEvent> listener)
Adds a point mouse over listener, which will be notified when the mouse
enters the neighborhood of a data point
|
Registration |
addPointRemoveListener(ComponentEventListener<PointRemoveEvent> listener)
Adds a point remove listener, which will be notified when a data point is
removed.
|
Registration |
addPointSelectListener(ComponentEventListener<PointSelectEvent> listener)
Adds a point select listener, which will be notified when a data point is
selected.
|
Registration |
addPointUnselectListener(ComponentEventListener<PointUnselectEvent> listener)
Adds a point unselect listener, which will be notified when a data point
is unselected.
|
Registration |
addPointUpdateListener(ComponentEventListener<PointUpdateEvent> listener)
Adds a point update listener, which will be notified when a data point is
updated.
|
Registration |
addSeriesAfterAnimateListener(ComponentEventListener<SeriesAfterAnimateEvent> listener)
Adds a series after animate listener, which will be notified after a
series is animated
|
Registration |
addSeriesClickListener(ComponentEventListener<SeriesClickEvent> listener)
Adds a series click listener, which will be notified of clicks on the
series in the chart
|
Registration |
addSeriesHideListener(ComponentEventListener<SeriesHideEvent> listener)
Adds a series hide listener, which will be notified when a series is
hidden
|
Registration |
addSeriesLegendItemClickListener(ComponentEventListener<SeriesLegendItemClickEvent> listener)
Adds a series legend item click listener, which will be notified of
clicks on the legend's items corresponding to a Series
|
Registration |
addSeriesMouseOutListener(ComponentEventListener<SeriesMouseOutEvent> listener)
Adds a point mouse out listener, which will be notified when the mouse
exits the neighborhood of a series
|
Registration |
addSeriesMouseOverListener(ComponentEventListener<SeriesMouseOverEvent> listener)
Adds a point mouse out listener, which will be notified when the mouse
enters the neighborhood of a series
|
Registration |
addSeriesShowListener(ComponentEventListener<SeriesShowEvent> listener)
Adds a series show listener, which will be notified when a series is
shown
|
Registration |
addXAxesExtremesSetListener(ComponentEventListener<XAxesExtremesSetEvent> listener)
Adds a x axes extremes set listener, which will be notified when an x
axis extremes are set
|
Registration |
addYAxesExtremesSetListener(ComponentEventListener<YAxesExtremesSetEvent> listener)
Adds a y axes extremes set listener, which will be notified when an y
axis extremes are set
|
void |
drawChart()
Draws a chart using the current configuration.
|
void |
drawChart(boolean resetConfiguration)
Draws a chart using the current configuration.
|
Configuration |
getConfiguration() |
protected void |
onAttach(AttachEvent attachEvent)
Called when the component is attached to a UI.
|
void |
setTimeline(Boolean timeline)
Determines if the chart is a timeline chart or a normal chart.
|
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.
|
addListener, fireEvent, from, get, getChildren, getElement, getEventBus, getId, getLocale, getParent, getTranslation, getTranslation, getTranslation, getTranslation, getUI, hasListener, isAttached, isTemplateMapped, isVisible, onDetach, onEnabledStateChanged, set, setElement, setId, setVisible
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addClassName, addClassNames, getClassName, getClassNames, getStyle, hasClassName, removeClassName, removeClassNames, setClassName, setClassName
getCssSize, getHeight, getHeightUnit, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getWidth, getWidthUnit, setHeight, setHeight, setHeightFull, setMaxHeight, setMaxHeight, setMaxWidth, setMaxWidth, setMinHeight, setMinHeight, setMinWidth, setMinWidth, setSizeFull, setSizeUndefined, setWidth, setWidth, setWidthFull
getElement
addAttachListener
addDetachListener
protected void onAttach(AttachEvent attachEvent)
Component
The default implementation does nothing.
This method is invoked before the AttachEvent
is fired for the
component.
public void drawChart()
drawChart(boolean)
public void drawChart(boolean resetConfiguration)
The chart takes the current configuration from
getConfiguration()
.
Note that if you modify the underlying Series
directly, the chart
will automatically be updated.
Note that you don't need to call this method if Configuration
is
ready before element is attached.
resetConfiguration
- defines whether the chart should be redrawn or notgetConfiguration()
public void setTimeline(Boolean timeline)
IllegalArgumentException
timeline
- true for timeline chartpublic void setVisibilityTogglingDisabled(boolean disabled)
true
) will disable this
behavior.disabled
- public Configuration getConfiguration()
public Registration addChartAddSeriesListener(ComponentEventListener<ChartAddSeriesEvent> listener)
listener
- public Registration addChartAfterPrintListener(ComponentEventListener<ChartAfterPrintEvent> listener)
listener
- public Registration addChartBeforePrintListener(ComponentEventListener<ChartBeforePrintEvent> listener)
listener
- public Registration addChartClickListener(ComponentEventListener<ChartClickEvent> listener)
listener
- public Registration addChartDrillupListener(ComponentEventListener<ChartDrillupEvent> listener)
listener
- public Registration addChartDrillupAllListener(ComponentEventListener<ChartDrillupAllEvent> listener)
listener
- public Registration addChartLoadListener(ComponentEventListener<ChartLoadEvent> listener)
listener
- public Registration addChartRedrawListener(ComponentEventListener<ChartRedrawEvent> listener)
listener
- public Registration addCheckBoxClickListener(ComponentEventListener<SeriesCheckboxClickEvent> listener)
listener
- public Registration addDrilldownListener(ComponentEventListener<DrilldownEvent> listener)
listener
- addItemWithDrilldown
to find out how to enable async drilldown
public Registration addChartSelectionListener(ComponentEventListener<ChartSelectionEvent> listener)
Note 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.
listener
- public Registration addSeriesLegendItemClickListener(ComponentEventListener<SeriesLegendItemClickEvent> listener)
Note that by default, clicking on a legend item toggles the visibility of
its associated series. To disable this behavior call
setVisibilityTogglingDisabled(true
)
listener
- setVisibilityTogglingDisabled(boolean)
public Registration addPointLegendItemClickListener(ComponentEventListener<PointLegendItemClickEvent> listener)
Note that by default, clicking on a legend item toggles the visibility of
its associated point. To disable this behavior call
setVisibilityTogglingDisabled(true
)
listener
- setVisibilityTogglingDisabled(boolean)
public Registration addSeriesAfterAnimateListener(ComponentEventListener<SeriesAfterAnimateEvent> listener)
listener
- public Registration addSeriesClickListener(ComponentEventListener<SeriesClickEvent> listener)
listener
- public Registration addSeriesHideListener(ComponentEventListener<SeriesHideEvent> listener)
listener
- public Registration addSeriesMouseOutListener(ComponentEventListener<SeriesMouseOutEvent> listener)
listener
- public Registration addSeriesMouseOverListener(ComponentEventListener<SeriesMouseOverEvent> listener)
listener
- public Registration addSeriesShowListener(ComponentEventListener<SeriesShowEvent> listener)
listener
- public Registration addPointClickListener(ComponentEventListener<PointClickEvent> listener)
listener
- public Registration addPointMouseOutListener(ComponentEventListener<PointMouseOutEvent> listener)
listener
- public Registration addPointMouseOverListener(ComponentEventListener<PointMouseOverEvent> listener)
listener
- public Registration addPointRemoveListener(ComponentEventListener<PointRemoveEvent> listener)
listener
- public Registration addPointSelectListener(ComponentEventListener<PointSelectEvent> listener)
listener
- public Registration addPointUnselectListener(ComponentEventListener<PointUnselectEvent> listener)
listener
- public Registration addPointUpdateListener(ComponentEventListener<PointUpdateEvent> listener)
listener
- public Registration addXAxesExtremesSetListener(ComponentEventListener<XAxesExtremesSetEvent> listener)
listener
- public Registration addYAxesExtremesSetListener(ComponentEventListener<YAxesExtremesSetEvent> listener)
listener
- Copyright © 2025. All rights reserved.