Class UIChartEvent
- All Implemented Interfaces:
IMessageBox
ChartOption.CLICK_EVENTS and ChartOption.HOVER_EVENTS, both off by default.The event names the plot, the series and the index of the value in the series as the client drew them, the value's x and y as the client drew them, and the value property itself when it is still in the series: a live series may have dropped it by the time the event arrives, so getSeriesValue() may be null while the index and numbers stay what the user saw. For a pie, the index is the slice, x is the index and y the slice's value.
The event is fired on the client session's worker, the method tagged with OnUIChart after the listeners of the chart.
- Author:
- Christopher Mindus
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface IMessageBox
IMessageBox.IconField Summary
Fields inherited from interface IMessageBox
ICON_ERROR, ICON_INFORMATION, ICON_MAP, ICON_NONE, ICON_QUESTION, ICON_WARNINGConstructor Summary
ConstructorsConstructorDescriptionUIChartEvent(UIChart source, UIChartEvent.Type type, Plot2D plot, Series series, SeriesValue value, int index, double x, double y, String element) Constructs the event.Method Summary
Modifier and TypeMethodDescriptionGets the kind of element as dojox names it: "marker", "column", "bar", "slice", "circle" (bubble), "candlestick", "spider_poly"...intgetIndex()Gets the index of the value in the series as the client drew it; for a pie, the slice.getPlot()Gets the plot of the element.Gets the series of the element.Gets the value property of the element.Gets the UI component that is the source of the event.getType()Gets the type of the event.doublegetX()Gets the x of the value as the client drew it: the x of an X/Y value, the position (one-based) of a simple value, the index for a pie.doublegetY()Gets the y of the value as the client drew it: the value of a simple value or of a slice, the y of an X/Y value.protected StringGets the parameter string.Methods inherited from class UIBaseEvent
getAppSessionGyro, getClientSessionGyro, getContainerFirstUIComponent, getContainerFirstUIComponentNull, getFirstUIComponent, getFirstUIComponentNull, getPanelUIComponent, getPanelUIComponentNull, getUIPanel, getVirtualSpaceMethods inherited from class BaseEvent
getAction, getAction2, getActionNull, getActionNull2, getField, getField2, getFieldNull, getFieldNull2, getGroup, getGroup2, getGroupNull, getGroupNull2, getTable, getTable2, getTableNull, getTableNull2, getTime, getVirtualizedVirtualSpace, getVSComponent, getVSComponent2, getVSComponentNull, getVSComponentNull2, messageBox, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface IMessageBox
messageBox, messageBox, messageBox
Constructor Details
UIChartEvent
public UIChartEvent(UIChart source, UIChartEvent.Type type, Plot2D plot, Series series, SeriesValue value, int index, double x, double y, String element) Constructs the event.- Parameters:
source- The source.type- The type.plot- The plot.series- The series.value- The value property, or null if no longer in the series.index- The index of the value in the series as the client drew it.x- The x of the value as drawn, NaN if none.y- The y of the value as drawn, NaN if none.element- The kind of element: "marker", "column", "bar", "slice", "circle", "candlestick"...- Throws:
NullPointerException- If the source is null.
Method Details
getSource
getType
getPlot
getSeries
getSeriesValue
Gets the value property of the element.- Returns:
- The value property, or null if the series no longer holds it (a live series that dropped it, a value removed meanwhile).
getIndex
public int getIndex()Gets the index of the value in the series as the client drew it; for a pie, the slice.The index, like
getX()andgetY(), is what the client reports: the server checks that it is not negative, not that the series still holds a value there (a live series may have dropped values since). Code that reads the series with it checks it against the series first, or usesgetSeriesValue(), which the server looks up itself.- Returns:
- The index, zero-based.
getX
public double getX()Gets the x of the value as the client drew it: the x of an X/Y value, the position (one-based) of a simple value, the index for a pie.- Returns:
- The x, or NaN if none.
getY
public double getY()Gets the y of the value as the client drew it: the value of a simple value or of a slice, the y of an X/Y value.- Returns:
- The y, or NaN if none.
getElement
Gets the kind of element as dojox names it: "marker", "column", "bar", "slice", "circle" (bubble), "candlestick", "spider_poly"...- Returns:
- The kind, never null.
paramString
Gets the parameter string.- Overrides:
paramStringin classBaseEvent<UIChart>