com.sencha.gxt.chart.client.chart.series
Class Series<M>

java.lang.Object
  extended by com.sencha.gxt.chart.client.chart.series.Series<M>
Type Parameters:
M - the data type of the series
All Implemented Interfaces:
SeriesHandler.HasSeriesHandlers, SeriesItemOutEvent.HasSeriesItemOutHandlers, SeriesItemOverEvent.HasSeriesItemOverHandlers, SeriesSelectionEvent.HasSeriesSelectionHandlers
Direct Known Subclasses:
MultipleColorSeries, ScatterSeries

public abstract class Series<M>
extends Object
implements SeriesHandler.HasSeriesHandlers, SeriesSelectionEvent.HasSeriesSelectionHandlers, SeriesItemOutEvent.HasSeriesItemOutHandlers, SeriesItemOverEvent.HasSeriesItemOverHandlers

Series is the abstract class containing the common logic to all chart series. This class implements the logic of handling mouse events, animating, hiding, showing all elements and returning the color of the series to be used as a legend item.


Nested Class Summary
static class Series.LabelPosition
          Enumeration used for labels positioned on the series.
 
Constructor Summary
Series()
          Creates a series.
 
Method Summary
 HandlerRegistration addSeriesHandler(SeriesHandler handler)
          Adds a SeriesHandler handler for SeriesSelectionEvent, SeriesItemOutEvent, SeriesItemOverEvent events.
 HandlerRegistration addSeriesItemOutHandler(SeriesItemOutEvent.SeriesItemOutHandler handler)
          Adds a SeriesItemOutEvent.SeriesItemOutHandler handler for SeriesItemOutEvent events.
 HandlerRegistration addSeriesItemOverHandler(SeriesItemOverEvent.SeriesItemOverHandler handler)
          Adds a SeriesItemOverEvent.SeriesItemOverHandler handler for SeriesItemOverEvent events.
 HandlerRegistration addSeriesSelectionHandler(SeriesSelectionEvent.SeriesSelectionHandler handler)
          Adds a SeriesSelectionEvent.SeriesSelectionHandler handler for SeriesSelectionEvent events.
 void calculateBBox(boolean gutter)
          Calculates the bounding the box of the series and stores the result.
 void delete()
          Removes all the sprites of the series from the surface.
abstract  void drawSeries()
          Draws the series for the current chart.
 PreciseRectangle getBBox()
          Returns the bounding box of the series.
 Chart<M> getChart()
          Returns the chart that the series is attached.
 double[] getGutters()
          Returns the axis insets of the series.
 SeriesHighlighter getHighlighter()
          Return the SeriesHighlighter used by the series.
 SeriesLabelConfig<M> getLabelConfig()
          Returns the configuration for labels on the series.
 Map<Integer,String> getLegendNames()
          Returns the map of names used in the legend.
 List<String> getLegendTitles()
          Returns the list of titles used in the legend of the series.
 SeriesRenderer<M> getRenderer()
          Return the custom sprite renderer on the series.
 Color getStroke()
          Return the stroke color of the series.
 double getStrokeWidth()
          Return the stroke width of the series.
 ToolTip getToolTip()
          Return the generated tool tip from the tool tip config.
 SeriesToolTipConfig<M> getToolTipConfig()
          Returns the tooltip configuration.
 ValueProvider<M,? extends Number> getXField()
          Returns the value provider for the x-axis of the series.
 Chart.Position getYAxisPosition()
          Returns the y axis position of the series.
abstract  void hide(int yFieldIndex)
          Hides the given y field index from the series.
abstract  void highlight(int index)
          Highlights the series at the given index.
abstract  void highlightAll(int index)
          Highlights all of the items in the series.
 boolean highlightedState()
          Returns whether or not the series is actively highlighted.
 boolean isHighlighting()
          Returns whether or not the series uses highlighting.
 boolean isShownInLegend()
          Returns whether or not the series is shown in the legend.
 void onMouseDown(PrecisePoint point)
          Method used when the series is clicked.
 int onMouseMove(PrecisePoint point)
          Method used when the series is moused over.
 void onMouseOut(PrecisePoint point)
          Method used when the mouse leaves the series.
 void removeToolTip()
          Removes the components tooltip (if one exists).
 void setChart(Chart<M> chart)
          Sets the chart that the series is attached.
 void setHighlighter(SeriesHighlighter highlighter)
          Set the SeriesHighlighter used by the series.
 void setHighlighting(boolean highlighting)
          Sets whether or not the series uses highlighting.
 void setLabelConfig(SeriesLabelConfig<M> labelConfig)
          Sets the configuration for labels on the series.
 void setRenderer(SeriesRenderer<M> renderer)
          Sets a custom sprite renderer on the series.
 void setShownInLegend(boolean showInLegend)
          Sets whether or not the series is shown in the legend.
 void setStroke(Color stroke)
          Sets the stroke color of the series.
 void setStrokeWidth(double strokeWidth)
          Sets the stroke width of the series.
 void setToolTipConfig(SeriesToolTipConfig<M> config)
          Sets the tooltip configuration.
 void setXField(ValueProvider<M,? extends Number> xField)
          Sets the value provider for the x-axis of the series.
 void setYAxisPosition(Chart.Position yAxisPosition)
          Sets the position of the y axis on the chart to be used by the series.
abstract  void show(int yFieldIndex)
          Shows the given y field index from the series.
abstract  void unHighlight(int index)
          Removes highlighting from the given index.
abstract  void unHighlightAll(int index)
          UnHighlights all items in the series.
abstract  boolean visibleInLegend(int index)
          Returns whether or not the given index is visible in legend.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Series

public Series()
Creates a series.

Method Detail

addSeriesHandler

public HandlerRegistration addSeriesHandler(SeriesHandler handler)
Description copied from interface: SeriesHandler.HasSeriesHandlers
Adds a SeriesHandler handler for SeriesSelectionEvent, SeriesItemOutEvent, SeriesItemOverEvent events.

Specified by:
addSeriesHandler in interface SeriesHandler.HasSeriesHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addSeriesItemOutHandler

public HandlerRegistration addSeriesItemOutHandler(SeriesItemOutEvent.SeriesItemOutHandler handler)
Description copied from interface: SeriesItemOutEvent.HasSeriesItemOutHandlers
Adds a SeriesItemOutEvent.SeriesItemOutHandler handler for SeriesItemOutEvent events.

Specified by:
addSeriesItemOutHandler in interface SeriesItemOutEvent.HasSeriesItemOutHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addSeriesItemOverHandler

public HandlerRegistration addSeriesItemOverHandler(SeriesItemOverEvent.SeriesItemOverHandler handler)
Description copied from interface: SeriesItemOverEvent.HasSeriesItemOverHandlers
Adds a SeriesItemOverEvent.SeriesItemOverHandler handler for SeriesItemOverEvent events.

Specified by:
addSeriesItemOverHandler in interface SeriesItemOverEvent.HasSeriesItemOverHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

addSeriesSelectionHandler

public HandlerRegistration addSeriesSelectionHandler(SeriesSelectionEvent.SeriesSelectionHandler handler)
Description copied from interface: SeriesSelectionEvent.HasSeriesSelectionHandlers
Adds a SeriesSelectionEvent.SeriesSelectionHandler handler for SeriesSelectionEvent events.

Specified by:
addSeriesSelectionHandler in interface SeriesSelectionEvent.HasSeriesSelectionHandlers
Parameters:
handler - the handler
Returns:
the registration for the event

calculateBBox

public void calculateBBox(boolean gutter)
Calculates the bounding the box of the series and stores the result. To get the result us getBBox().

Parameters:
gutter - true if to use the series gutter in the calculation

delete

public void delete()
Removes all the sprites of the series from the surface.


drawSeries

public abstract void drawSeries()
Draws the series for the current chart.


getBBox

public PreciseRectangle getBBox()
Returns the bounding box of the series.

Returns:
the bounding box of the series

getChart

public Chart<M> getChart()
Returns the chart that the series is attached.

Returns:
the chart that the series is attached

getGutters

public double[] getGutters()
Returns the axis insets of the series.

Returns:
the axis insets of the series

getHighlighter

public SeriesHighlighter getHighlighter()
Return the SeriesHighlighter used by the series.

Returns:
the series highlighter

getLabelConfig

public SeriesLabelConfig<M> getLabelConfig()
Returns the configuration for labels on the series.

Returns:
the configuration for labels on the series

getLegendNames

public Map<Integer,String> getLegendNames()
Returns the map of names used in the legend.

Returns:
the map of names used in the legend

getLegendTitles

public List<String> getLegendTitles()
Returns the list of titles used in the legend of the series.

Returns:
the list of titles used in the legend of the series

getRenderer

public SeriesRenderer<M> getRenderer()
Return the custom sprite renderer on the series.

Returns:
the custom sprite renderer on the series

getStroke

public Color getStroke()
Return the stroke color of the series.

Returns:
the stroke color of the series

getStrokeWidth

public double getStrokeWidth()
Return the stroke width of the series.

Returns:
the stroke width of the series

getToolTip

public ToolTip getToolTip()
Return the generated tool tip from the tool tip config.

Returns:
the generated tool tip

getToolTipConfig

public SeriesToolTipConfig<M> getToolTipConfig()
Returns the tooltip configuration.

Returns:
the tooltip configuration

getXField

public ValueProvider<M,? extends Number> getXField()
Returns the value provider for the x-axis of the series.

Returns:
the value provider for the x-axis of the series

getYAxisPosition

public Chart.Position getYAxisPosition()
Returns the y axis position of the series.

Returns:
the y axis position of the series

hide

public abstract void hide(int yFieldIndex)
Hides the given y field index from the series.

Parameters:
yFieldIndex - the index of the y field

highlight

public abstract void highlight(int index)
Highlights the series at the given index.

Parameters:
index - the index to be highlighted

highlightAll

public abstract void highlightAll(int index)
Highlights all of the items in the series.

Parameters:
index - the index of the series

highlightedState

public boolean highlightedState()
Returns whether or not the series is actively highlighted.

Returns:
true if highlighted

isHighlighting

public boolean isHighlighting()
Returns whether or not the series uses highlighting.

Returns:
whether or not the series uses highlighting

isShownInLegend

public boolean isShownInLegend()
Returns whether or not the series is shown in the legend.

Returns:
true if the series is shown in the legend

onMouseDown

public void onMouseDown(PrecisePoint point)
Method used when the series is clicked.

Parameters:
point - the point clicked

onMouseMove

public int onMouseMove(PrecisePoint point)
Method used when the series is moused over.

Parameters:
point - the point moused over
Returns:
the index of the moused over item

onMouseOut

public void onMouseOut(PrecisePoint point)
Method used when the mouse leaves the series.

Parameters:
point - the point left

removeToolTip

public void removeToolTip()
Removes the components tooltip (if one exists).


setChart

public void setChart(Chart<M> chart)
Sets the chart that the series is attached.

Parameters:
chart - the chart that the series is attached

setHighlighter

public void setHighlighter(SeriesHighlighter highlighter)
Set the SeriesHighlighter used by the series.

Parameters:
highlighter - the series highlighter

setHighlighting

public void setHighlighting(boolean highlighting)
Sets whether or not the series uses highlighting.

Parameters:
highlighting - whether or not the series uses highlighting

setLabelConfig

public void setLabelConfig(SeriesLabelConfig<M> labelConfig)
Sets the configuration for labels on the series.

Parameters:
labelConfig - the label configuration

setRenderer

public void setRenderer(SeriesRenderer<M> renderer)
Sets a custom sprite renderer on the series.

Parameters:
renderer - the renderer

setShownInLegend

public void setShownInLegend(boolean showInLegend)
Sets whether or not the series is shown in the legend.

Parameters:
showInLegend - true if the series is shown in the legend

setStroke

public void setStroke(Color stroke)
Sets the stroke color of the series.

Parameters:
stroke - the stroke color of the series

setStrokeWidth

public void setStrokeWidth(double strokeWidth)
Sets the stroke width of the series.

Parameters:
strokeWidth - the stroke width of the series

setToolTipConfig

public void setToolTipConfig(SeriesToolTipConfig<M> config)
Sets the tooltip configuration.

Parameters:
config - the tooltip configuration

setXField

public void setXField(ValueProvider<M,? extends Number> xField)
Sets the value provider for the x-axis of the series.

Parameters:
xField - the value provider for the x-axis of the series

setYAxisPosition

public void setYAxisPosition(Chart.Position yAxisPosition)
Sets the position of the y axis on the chart to be used by the series.

Parameters:
yAxisPosition - the position of the y axis on the chart to be used by the series

show

public abstract void show(int yFieldIndex)
Shows the given y field index from the series.

Parameters:
yFieldIndex - the index of the y field

unHighlight

public abstract void unHighlight(int index)
Removes highlighting from the given index.

Parameters:
index - the index to have its highlighting removed

unHighlightAll

public abstract void unHighlightAll(int index)
UnHighlights all items in the series.

Parameters:
index - the index of the series

visibleInLegend

public abstract boolean visibleInLegend(int index)
Returns whether or not the given index is visible in legend.

Parameters:
index - the index to determine visible
Returns:
whether or not it is visible


Copyright © 2011. All Rights Reserved.