org.moxieapps.gwt.highcharts.client
Class Series

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<Series>
      extended by org.moxieapps.gwt.highcharts.client.Series

public class Series
extends Configurable<Series>

Manages a data series (and its options) that can then be added to a Chart. As an extension of Configurable each series instance can also optionally have configuration options set on it. In order to create a new series, utilize the BaseChart.createSeries() method, configure it, add data to it, and then add it to the chart via the BaseChart.addSeries(org.moxieapps.gwt.highcharts.client.Series) method. Note that a series can be modified after the chart has been rendered as well, which allows for support of dynamic charts or series that change in some way based on user behavior. Simple example of setting up a series on a chart:

 Series series = chart.createSeries()
   .setName("Random Stuff")
   .addPoint(40)
   .addPoint(35)
   .addPoint(60);
 chart.addSeries(series);
 
Example of updating all of the points in a series at once:
 chart.addSeries(chart.createSeries()
   .setName("Random Stuff")
   .setPoints(new Number[] { 40, 35, 60 })
 );
 
Example of changing the options for one point in the series:
 chart.addSeries(chart.createSeries()
   .setName("Random Stuff")
   .addPoint(40)
   .addPoint(new Point(35).setColor("#BF0B23"))
   .addPoint(60)
 );
 

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)

Nested Class Summary
static class Series.Type
          An enumeration of supported series types, which can be passed to methods such as setType(org.moxieapps.gwt.highcharts.client.Series.Type) or BaseChart.setType(org.moxieapps.gwt.highcharts.client.Series.Type).
 
Constructor Summary
protected Series(BaseChart chart)
          Use the BaseChart.createSeries() method to create new series instances.
 
Method Summary
 Series addPoint(Number y)
          Simplest way to add a point using the default options, and setting only the Y value that the point should be rendered at within the series.
 Series addPoint(Number y, boolean redraw, boolean shift, Animation animation)
          Add a point to the series with a specific value on the Y axis, controlling the options on how the change will be drawn to the series.
 Series addPoint(Number y, boolean redraw, boolean shift, boolean animation)
          Add a point to the series with a specific value on the Y axis, controlling the options on how the change will be drawn to the series.
 Series addPoint(Number x, Number y)
          Simple way to add a point using the default options, and setting only the X and Y value that the point should be rendered at within the series.
 Series addPoint(Number x, Number y, boolean redraw, boolean shift, Animation animation)
          Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.
 Series addPoint(Number x, Number y, boolean redraw, boolean shift, boolean animation)
          Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.
 Series addPoint(Number x, Number low, Number high)
          Simple way to add a point using the default options, and setting only the X, Low, and High values that the point should be rendered at within the series (for Area Range charts).
 Series addPoint(Number x, Number open, Number high, Number low, Number close)
          Simple way to add a point using the default options, and setting only the X, Open, High, Low, and Close values that the point should be rendered at within the series (for OHLC charts).
 Series addPoint(Number x, Number open, Number high, Number low, Number close, boolean redraw, boolean shift, Animation animation)
          Add a point to the series with a specific value on the X and Y axis (in OHLC format), controlling the options on how the change will be drawn to the series.
 Series addPoint(Number x, String title, String text)
          Add a point to the series that is to be used as a flag.
 Series addPoint(Point point)
          Add a point to the series accepting the default options on how the point will be drawn.
 Series addPoint(Point point, boolean redraw, boolean shift, Animation animation)
          Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.
 Series addPoint(Point point, boolean redraw, boolean shift, boolean animation)
          Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.
 String getId()
          The internally generated unique id for this series
 String getName()
          /** Convenience method for getting the 'name' of a particular series.
 com.google.gwt.core.client.JavaScriptObject getNativeSeries()
          For advanced use-cases only.
 Point[] getPoints()
          Retrieve the array of points that have been added to this series.
 Series hide()
          Hides the series if visible.
 boolean isVisible()
          Retrieve the series' visibility state as set by show(), hide(), or the initial configuration.
 boolean remove()
          Remove this series from the chart it is a part of.
 Series removePoint(Point point)
          Remove the point from the series, automatically redrawing the chart using the default animation options.
 Series removePoint(Point point, boolean redraw, Animation animation)
          Remove the point from the series, explicitly controlling whether the chart is redrawn and the details of the animation options.
 Series removePoint(Point point, boolean redraw, boolean animation)
          Remove the point from the series, explicitly controlling whether the chart is redrawn and/or animated or not.
 Series select(boolean select)
          Select or unselect the series.
 Series selectToggle()
          Select the series if it is currently unselected, or unselect the series if it is currently selected.
 Series setColorByPoint(boolean colorByPoint)
          Convenience method for setting the 'colorByPoint' option of the series.
 Series setIndex(Number index)
          Convenience method for setting the 'index' option of the series.
 Series setLegendIndex(Number legendIndex)
          Convenience method for setting the 'index' option of the series.
 Series setName(String name)
          Convenience method for setting the 'name' option of the series.
 Series setPlotOptions(PlotOptions plotOptions)
          Updates the plot options for this series to reflect the given options.
 Series setPoints(com.google.gwt.json.client.JSONArray points, boolean redraw)
          Apply a new set of data to a series with the option to redraw the chart.
 Series setPoints(Number[] yValues)
          Apply a new set of data (Y values only) to the series and automatically redraw it.
 Series setPoints(Number[][] values)
          Apply a new set of data to the series and automatically redraw it.
 Series setPoints(Number[][] values, boolean redraw)
          Apply a new set of data to the series and optionally redraw it.
 Series setPoints(Number[] yValues, boolean redraw)
          Apply a new set of data (Y values only) to the series and optionally redraw it.
 Series setPoints(Point[] points)
          Apply a new set of data to the series and automatically redraw it.
 Series setPoints(Point[] points, boolean redraw)
          Apply a new set of data to the series and optionally redraw it.
 Series setStack(Number stack)
          Convenience method for setting the 'stack' option of the series to a number.
 Series setStack(String stack)
          Convenience method for setting the 'stack' option of the series to a string.
 Series setToolTip(ToolTip toolTip)
          Convenience method for setting the 'tooltip' option of the series.
 Series setType(Series.Type type)
          Sets the type of this series (which controls the way the series will be rendered), using an enumeration type in order to ensure a correct value is passed.
 Series setVisible(boolean visible)
          Either shows or hides the series, and then automatically redraws the chart.
 Series setVisible(boolean visible, boolean redraw)
          Either shows or hides the series, and then optionally redraws the chart.
 Series setXAxis(Number xAxis)
          Convenience method for setting the 'xAxis' property of the series to a number.
 Series setYAxis(Number yAxis)
          Convenience method for setting the 'yAxis' property of the series to a number.
 Series show()
          Shows the series if hidden.
 Series update(Series seriesOptions)
          Update the series with a new set of options, automatically redrawing the chart.
 Series update(Series seriesOptions, boolean redraw)
          Update the series with a new set of options.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable
getOptions, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Series

protected Series(BaseChart chart)
Use the BaseChart.createSeries() method to create new series instances.

Parameters:
chart - The chart instance that this series is being created within.
Method Detail

setColorByPoint

public Series setColorByPoint(boolean colorByPoint)
Convenience method for setting the 'colorByPoint' option of the series. Equivalent to:

     series.setOption("colorByPoint", true);
 
When using automatic point colors pulled from the options.colors collection, this option determines whether the chart should receive one color per series or one color per point. Defaults to false.

Parameters:
colorByPoint - Whether the chart should receive one color per series or one color per point.
Returns:
reference to this Series instance for convenient method chaining.

setIndex

public Series setIndex(Number index)
Convenience method for setting the 'index' option of the series. Equivalent to:

     series.setOption("index", 1);
 
The index of the series in the chart, affecting the internal index in the chart.series array, the visible Z index as well as the order in the legend.

Parameters:
index - The series' index in the internal chart.series array.
Returns:
A reference to this Series instance for convenient method chaining.

setLegendIndex

public Series setLegendIndex(Number legendIndex)
Convenience method for setting the 'index' option of the series. Equivalent to:

     series.setOption("index", 1);
 
The sequential index of the series in the legend.

Parameters:
legendIndex - A number representing the position of the series in the legend.
Returns:
A reference to this Series instance for convenient method chaining.

setName

public Series setName(String name)
Convenience method for setting the 'name' option of the series. Equivalent to:

     series.setOption("name", "My Chart");
 
The name of the series as shown in the legend, tooltip etc. Defaults to "".

Parameters:
name - The string to set as the series name.
Returns:
A reference to this Series instance for convenient method chaining.

getName

public String getName()
/** Convenience method for getting the 'name' of a particular series. Equivalent to:

     series.getName()
 

Returns:
The name of a Series as a String, or null if no name is set by setName(String).
Since:
1.6.0

setStack

public Series setStack(String stack)
Convenience method for setting the 'stack' option of the series to a string. Equivalent to:

     series.setOption("stack", "Stack 1");
 
The 'stack' option allows grouping series in a stacked chart. Defaults to null. Note that you can also set this option to a number instead via the setStack(Number) method.

Parameters:
stack - The string to set as the 'stack' option on the series.
Returns:
A reference to this Series instance for convenient method chaining.

setStack

public Series setStack(Number stack)
Convenience method for setting the 'stack' option of the series to a number. Equivalent to:

     series.setOption("stack", 1);
 
The 'stack' option allows grouping series in a stacked chart. Defaults to null. Note that you can also set this option to a string instead via the setStack(String) method.

Parameters:
stack - The number to set as the 'stack' option on the series.
Returns:
A reference to this Series instance for convenient method chaining.

setToolTip

public Series setToolTip(ToolTip toolTip)
Convenience method for setting the 'tooltip' option of the series. Equivalent to:

     series.setOption("/tooltip/borderColor", "#CCCCCC");
     series.setOption("/tooltip/shadow", true);
     etc..
 
The tooltip appears when the user hovers over a series or point.

Parameters:
toolTip - The options to apply to the tooltip of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setType

public Series setType(Series.Type type)
Sets the type of this series (which controls the way the series will be rendered), using an enumeration type in order to ensure a correct value is passed. This is equivalent to setting the option manually with code like:

     series.setOption("type", "line");
 
Note that if you don't set this explicitly the default series type is Series.Type.LINE.

Parameters:
type - One of the supported series types.
Returns:
A reference to this Series instance for convenient method chaining.

setXAxis

public Series setXAxis(Number xAxis)
Convenience method for setting the 'xAxis' property of the series to a number. Equivalent to:

     series.setOption("xAxis", 1);
 
When using dual or multiple x axes, this number defines which xAxis the particular series is connected to. It refers to the index of the axis in the xAxis array, with 0 being the first. Defaults to 0.

Parameters:
xAxis - The number to set as the 'xAxis' option on the series.
Returns:
A reference to this Series instance for convenient method chaining.

setYAxis

public Series setYAxis(Number yAxis)
Convenience method for setting the 'yAxis' property of the series to a number. Equivalent to:

     series.setOption("yAxis", 1);
 
When using dual or multiple y axes, this number defines which yAxis the particular series is connected to. It refers to the index of the axis in the yAxis array, with 0 being the first. Defaults to 0.

Parameters:
yAxis - The number to set as the 'yAxis' option on the series.
Returns:
A reference to this Series instance for convenient method chaining.

setPlotOptions

public Series setPlotOptions(PlotOptions plotOptions)
Updates the plot options for this series to reflect the given options. The default options for all series in the chart (of each type) can be set on the Chart instance, and therefore you only need to use this method if you want to override the plot options for this series only.

Note that the general PlotOptions type only represents the abstract base class of all the different series types. To call this method you need to instantiate one of the concrete sub-classes instead (e.g. AreaPlotOptions, BarPlotOptions, etc.).

Also note that changing the plot options for a series after it has been rendered to the screen does not change the way the live series will appear. If you need to change the plot options after the series is rendered, you'd instead need to first remove() the series from the chart and then re-add it to the chart via the BaseChart.addSeries(org.moxieapps.gwt.highcharts.client.Series) method.

Parameters:
plotOptions - The plot options to use for this series (or one of its sub-types)
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number y)
Simplest way to add a point using the default options, and setting only the Y value that the point should be rendered at within the series. See the various overloaded versions of the addPoint() method for more control over the way the point is rendered.

Parameters:
y - The value on the Y axis that the point should be drawn at within the series.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number x,
                       String title,
                       String text)
Add a point to the series that is to be used as a flag.

Parameters:
x - Point where the flag appears
title - Title of flag displayed on the chart
text - Text displayed when the flag are highlighted.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number y,
                       boolean redraw,
                       boolean shift,
                       boolean animation)
Add a point to the series with a specific value on the Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
y - The value on the Y axis that the point should be drawn at within the series.
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - Defaults to true. When true, the graph will be animated with default animation options. Note, see the addPoint(Number, boolean, boolean, org.moxieapps.gwt.highcharts.client.Animation) method for more control over how the animation will run.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number y,
                       boolean redraw,
                       boolean shift,
                       Animation animation)
Add a point to the series with a specific value on the Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
y - The value on the Y axis that the point should be drawn at within the series.
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - The custom animation to use when adding the point to the series.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number x,
                       Number y)
Simple way to add a point using the default options, and setting only the X and Y value that the point should be rendered at within the series. See the various overloaded versions of the addPoint() method for more control over the way the point is rendered.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
y - The value on the Y axis that the point should be drawn at within the series.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number x,
                       Number low,
                       Number high)
Simple way to add a point using the default options, and setting only the X, Low, and High values that the point should be rendered at within the series (for Area Range charts). See the various overloaded versions of the addPoint() method for more control over the way the point is rendered.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
low - The "low" Y value that the point should be rendered at within the series.
high - The "high" Y value that the point should be rendered at within the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.5.0

addPoint

public Series addPoint(Number x,
                       Number open,
                       Number high,
                       Number low,
                       Number close)
Simple way to add a point using the default options, and setting only the X, Open, High, Low, and Close values that the point should be rendered at within the series (for OHLC charts). See the various overloaded versions of the addPoint() method for more control over the way the point is rendered.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
open - The "open" Y value that the point should be rendered at within the series.
high - The "high" Y value that the point should be rendered at within the series.
low - The "low" Y value that the point should be rendered at within the series.
close - The "close" Y value that the point should be rendered at within the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.2.0

addPoint

public Series addPoint(Number x,
                       Number y,
                       boolean redraw,
                       boolean shift,
                       boolean animation)
Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
y - The value on the Y axis that the point should be drawn at within the series.
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - Defaults to true. When true, the graph will be animated with default animation options. Note, see the addPoint(Number, Number, boolean, boolean, org.moxieapps.gwt.highcharts.client.Animation) method for more control over how the animation will run.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number x,
                       Number y,
                       boolean redraw,
                       boolean shift,
                       Animation animation)
Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
y - The value on the Y axis that the point should be drawn at within the series.
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - The custom animation to use when adding the point to the series.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Number x,
                       Number open,
                       Number high,
                       Number low,
                       Number close,
                       boolean redraw,
                       boolean shift,
                       Animation animation)
Add a point to the series with a specific value on the X and Y axis (in OHLC format), controlling the options on how the change will be drawn to the series.

Parameters:
x - The value on the X axis that the point should be drawn at within the series.
open - The "open" Y value that the point should be rendered at within the series.
high - The "high" Y value that the point should be rendered at within the series.
low - The "low" Y value that the point should be rendered at within the series.
close - The "close" Y value that the point should be rendered at within the series.
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - The custom animation to use when adding the point to the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.2.0

addPoint

public Series addPoint(Point point)
Add a point to the series accepting the default options on how the point will be drawn.

Parameters:
point - The point to add to the series (which, in turn, can have its own configuration options).
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Point point,
                       boolean redraw,
                       boolean shift,
                       boolean animation)
Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
point - The point to add to the series (which, in turn, can have its own configuration options).
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - Defaults to true. When true, the graph will be animated with default animation options. Note, see the addPoint(org.moxieapps.gwt.highcharts.client.Point, boolean, boolean, org.moxieapps.gwt.highcharts.client.Animation) method for more control over how the animation will run.
Returns:
A reference to this Series instance for convenient method chaining.

addPoint

public Series addPoint(Point point,
                       boolean redraw,
                       boolean shift,
                       Animation animation)
Add a point to the series with a specific value on the X and Y axis, controlling the options on how the change will be drawn to the series.

Parameters:
point - The point to add to the series (which, in turn, can have its own configuration options).
redraw - Whether to redraw the chart after the point is added. When adding more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the adding of points is finished.
shift - Defaults to false. When shift is true, one point is shifted off the start of the series as one is appended to the end. Use this option for live charts monitoring a value over time.
animation - The custom animation to use when adding the point to the series.
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Number[] yValues)
Apply a new set of data (Y values only) to the series and automatically redraw it. If you need more control than just simply setting the y values of each data point, then use the setPoints(org.moxieapps.gwt.highcharts.client.Point[]) method instead.

Parameters:
yValues - The array of Y values to set on the data series (replacing any data already in place)
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Number[] yValues,
                        boolean redraw)
Apply a new set of data (Y values only) to the series and optionally redraw it. If you need more control than just simply setting the y values of each data point, then use the setPoints(org.moxieapps.gwt.highcharts.client.Point[], boolean) method instead.

Parameters:
yValues - The array of Y values to set on the data series (replacing any data already in place)
redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and then call BaseChart.redraw() after.
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Number[][] values)
Apply a new set of data to the series and automatically redraw it. The format of the data values should match the chart type of the Series:

If you need more control than just simply setting the x and y values of each data point, then use the setPoints(org.moxieapps.gwt.highcharts.client.Point[]) method instead.

Parameters:
values - A two dimensional array of values, where the main array is the list of points and each inner array contains values matching the series data type, described above.
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Number[][] values,
                        boolean redraw)
Apply a new set of data to the series and optionally redraw it. The format of the data values should match the chart type of the Series:

If you need more control than just simply setting the x and y values of each data point, then use the setPoints(org.moxieapps.gwt.highcharts.client.Point[]) method instead.

Parameters:
values - A two dimensional array of values, where the main array is the list of points and each inner array contains values matching the series data type, described above.
redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and then call BaseChart.redraw() after.
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Point[] points)
Apply a new set of data to the series and automatically redraw it.

Parameters:
points - The array of points to set on the data series (replacing any data already in place)
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(Point[] points,
                        boolean redraw)
Apply a new set of data to the series and optionally redraw it.

Parameters:
points - The array of points to set on the data series (replacing any data already in place)
redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and then call BaseChart.redraw() after.
Returns:
A reference to this Series instance for convenient method chaining.

setPoints

public Series setPoints(com.google.gwt.json.client.JSONArray points,
                        boolean redraw)
Apply a new set of data to a series with the option to redraw the chart. Intended for use when asynchronously loading data into the chart.

Parameters:
points - A set of points represented as a JSONArray
redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and then call BaseChart.redraw() after.
Returns:
A reference to this Series instance for convenient method chaining.

getPoints

public Point[] getPoints()
Retrieve the array of points that have been added to this series. If this method is invoked before the series is rendered to a chart, then it will simply return the points that have been added so far. If it is invoked after the series has been rendered, then it will retrieve the JS point instances from the live Highcharts element and convert them to GWT points.

Returns:
The array of points, or an empty array (non null) if no points have been added to the series yet.

removePoint

public Series removePoint(Point point)
Remove the point from the series, automatically redrawing the chart using the default animation options.

Note that this method is only relevant given Point instances that are obtained from the chart after it has been rendered, such as via an event or dynamically retrieving the points of a series.

Also note that this method is primarily intended to ensure compatibility with chart's that have been set in persistent mode via the BaseChart.setPersistent(boolean) method. If you're using non-persistent charts, you can instead simply use the Point.remove() method to achieve the same affect.

Parameters:
point - The point instance (obtained dynamically from the chart) to remove from the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.3.0

removePoint

public Series removePoint(Point point,
                          boolean redraw,
                          boolean animation)
Remove the point from the series, explicitly controlling whether the chart is redrawn and/or animated or not.

Note that this method is only relevant given Point instances that are obtained from the chart after it has been rendered, such as via an event or dynamically retrieving the points of a series.

Also note that this method is primarily intended to ensure compatibility with chart's that have been set in persistent mode via the BaseChart.setPersistent(boolean) method. If you're using non-persistent charts, you can instead simply use the Point.remove(boolean, boolean) method to achieve the same affect.

Parameters:
point - The point instance (obtained dynamically from the chart) to remove from the series.
redraw - Whether to redraw the chart after the point is removed. When removing more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the removing of points is finished.
animation - Defaults to true. When true, the graph will be animated with default animation options. Note, see the removePoint(org.moxieapps.gwt.highcharts.client.Point, boolean, org.moxieapps.gwt.highcharts.client.Animation) method for more control over how the animation will run.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.3.0

removePoint

public Series removePoint(Point point,
                          boolean redraw,
                          Animation animation)
Remove the point from the series, explicitly controlling whether the chart is redrawn and the details of the animation options.

Note that this method is only relevant given Point instances that are obtained from the chart after it has been rendered, such as via an event or dynamically retrieving the points of a series.

Also note that this method is primarily intended to ensure compatibility with chart's that have been set in persistent mode via the BaseChart.setPersistent(boolean) method. If you're using non-persistent charts, you can instead simply use the Point.remove(boolean, org.moxieapps.gwt.highcharts.client.Animation) method to achieve the same affect.

Parameters:
point - The point instance (obtained dynamically from the chart) to remove from the series.
redraw - Whether to redraw the chart after the point is removed. When removing more than one point, it is highly recommended that the redraw option be set to false, and instead BaseChart.redraw() is explicitly called after the removing of points is finished.
animation - The custom animation to use when removing the point from the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.3.0

remove

public boolean remove()
Remove this series from the chart it is a part of.

Returns:
'true' if the series was a part of an active chart and successfully removed, or 'false' if the given series had not yet been added to any chart.

show

public Series show()
Shows the series if hidden. Only applies after the chart has been rendered. Note that if you need show many series at once consider using the setVisible(boolean, boolean) method instead.

Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.1.0

hide

public Series hide()
Hides the series if visible. If the BaseChart.setIgnoreHiddenSeries(boolean) option is true, the chart is automatically redrawn without this series. Only applies after the chart has been rendered. Note that if you need hide many series at once consider using the setVisible(boolean, boolean) method instead.

Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.1.0

setVisible

public Series setVisible(boolean visible)
Either shows or hides the series, and then automatically redraws the chart. Only applies after the chart has been rendered. Note that if you need to show/hide many series at once consider using the setVisible(boolean, boolean) method instead.

Parameters:
visible - Whether or not to show or hide the series.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.6.0

setVisible

public Series setVisible(boolean visible,
                         boolean redraw)
Either shows or hides the series, and then optionally redraws the chart. Only applies after the chart has been rendered. Note that if you need to show/hide many series at once use this method passing "false" for the 'redraw' parameter, and then use the BaseChart.redraw() method to update the chart once you're ready.

Parameters:
visible - Whether or not to show or hide the series.
redraw - Whether or not to automatically redraw the chart, or wait until the Chart.redraw() method is called.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.6.0

select

public Series select(boolean select)
Select or unselect the series. This means it's selected property is set, the checkbox in the legend is toggled and when selected, the series is returned in the BaseChart.getSelectedSeries() method.

Parameters:
select - When true, the series is selected. When false it is unselected. See the selectToggle() method to instead toggle the selection state.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.1.0

selectToggle

public Series selectToggle()
Select the series if it is currently unselected, or unselect the series if it is currently selected. See the select(boolean) method for more explicit control over the selection state of a series.

Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.1.0

isVisible

public boolean isVisible()
Retrieve the series' visibility state as set by show(), hide(), or the initial configuration.

Returns:
true if the series is visible, false if hidden or the chart has not yet been rendered.

getNativeSeries

public com.google.gwt.core.client.JavaScriptObject getNativeSeries()
For advanced use-cases only. Returns a pointer to the native Highchart's JS series instance that this GWT Series instance is associated with. Note that this method will only return a non-null value if it is called on a Series instance after the chart has been rendered.

Returns:
The native Highcharts JS series instance that this Series is associated with, or null if the chart has not yet been rendered.
Since:
1.4.0

getId

public String getId()
The internally generated unique id for this series

Returns:
The unique id of this series
Since:
1.6.0

update

public Series update(Series seriesOptions)
Update the series with a new set of options, automatically redrawing the chart.

Parameters:
seriesOptions - New options that will be merged into the series' existing options.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.6.1

update

public Series update(Series seriesOptions,
                     boolean redraw)
Update the series with a new set of options. For a clean and precise handling of new options, all methods and elements from the series is removed, and it is initiated from scratch. Therefore, this method is more performance expensive than some other utility methods like setData or setVisible.

Parameters:
seriesOptions - New options that will be merged into the series' existing options.
redraw - Whether to redraw the chart after the series is altered. If doing more operations on the chart, it is a good idea to set redraw to false and call chart.redraw() after.
Returns:
A reference to this Series instance for convenient method chaining.
Since:
1.6.1


Copyright © 2015. All Rights Reserved.