org.moxieapps.gwt.highcharts.client
Class BaseChart<T>

java.lang.Object
  extended by com.google.gwt.user.client.ui.UIObject
      extended by com.google.gwt.user.client.ui.Widget
          extended by org.moxieapps.gwt.highcharts.client.BaseChart<T>
All Implemented Interfaces:
com.google.gwt.event.logical.shared.HasAttachHandlers, com.google.gwt.event.shared.HasHandlers, com.google.gwt.user.client.EventListener, com.google.gwt.user.client.ui.HasVisibility, com.google.gwt.user.client.ui.IsWidget
Direct Known Subclasses:
Chart, StockChart

public abstract class BaseChart<T>
extends com.google.gwt.user.client.ui.Widget

The common base class for both Chart types as well as StockChart types. You should not use this class directly, but instead create an instance of one of those sub types.

Since:
1.0.0
Author:
squinn@moxiegroup.com (Shawn Quinn)
See Also:
Chart, StockChart

Nested Class Summary
static class BaseChart.PinchType
          An enumeration of supported chart pinch types, which can be passed to the setPinchType(PinchType) method.
static class BaseChart.ZoomType
          An enumeration of supported chart zoom types, which can be passed to the Chart.setZoomType(ZoomType) method.
 
Nested classes/interfaces inherited from class com.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.UIObject.DebugIdImpl, com.google.gwt.user.client.ui.UIObject.DebugIdImplEnabled
 
Field Summary
protected  CandlestickPlotOptions candlestickPlotOptions
           
protected  OHLCPlotOptions ohlcPlotOptions
           
 
Fields inherited from class com.google.gwt.user.client.ui.UIObject
DEBUG_ID_PREFIX
 
Constructor Summary
protected BaseChart()
          This class can not be created directly, but instead create an instance of one of the sub types such as Chart or StockChart.
 
Method Summary
 T addSeries(Series series)
          Add the given data series to the chart, using the default options.
 T addSeries(Series series, boolean redraw, Animation animation)
          Add a data series to this chart, controlling the redraw and animation options.
 T addSeries(Series series, boolean redraw, boolean animation)
          Add a data series to this chart, controlling the redraw and animation options.
protected  com.google.gwt.json.client.JSONObject convertSeriesToJSON(Series series)
           
 Series createSeries()
          Create a new data series that can be configured, and then added to this chart instance via the addSeries(Series) method.
protected abstract  String getChartTypeName()
          To be overridden in a sub class to return the JS type name of the chart instance that should be created when the chart is rendered.
 com.google.gwt.core.client.JavaScriptObject getNativeChart()
          Returns a pointer to the native Highcharts or Highstock chart instance that this GWT BaseChart instance is associated with.
 com.google.gwt.json.client.JSONObject getOptions()
          Retrieve all of the options that have been configured for this chart instance as a JSONObject.
 Point[] getSelectedPoints()
          Returns an array of all currently selected points in the chart.
 Series[] getSelectedSeries()
          Returns an array of all currently selected series in the chart.
 Series[] getSeries()
          Return an array of all the Series instances that have been added to this chart (either before or after the chart was rendered), or an empty array if none have been added yet.
 Series getSeries(String seriesId)
          Retrieve the series instance within the chart for the given id, or null if no series exists in the chart with the given id.
 String getSVG()
          Exporting module required.
 XAxis getXAxis()
          Retrieve a reference to the XAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 XAxis getXAxis(int axisIndex)
          Retrieve a reference to a specific XAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 YAxis getYAxis()
          Retrieve a reference to the YAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 YAxis getYAxis(int axisIndex)
          Retrieve a reference to a specific YAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 ZAxis getZAxis()
          Retrieve a reference to the ZAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 ZAxis getZAxis(int axisIndex)
          Retrieve a reference to a specific ZAxis for this chart (guaranteed non-null), so that it can then be configured or operated on.
 T hideLoading()
          Hide the loading screen.
 boolean isPersistent()
          By default the data associated with the series of the chart is only maintained within a GWT managed Java array until the chart is rendered, at which point the data points of the series are maintained exclusively within the DOM via the Highcharts API.
 boolean isRendered()
          Returns true if the chart has already been rendered to the DOM, or false otherwise.
protected  void onLoad()
           
protected  void onUnload()
           
 T print()
          Exporting module required.
 T redraw()
          Redraw the chart after changes have been done to the data or axis extremes.
 T reflow()
          Reflows the chart to its container.
 T removeAllSeries()
          A convenience method to run through and remove all of the series that are currently part of the chart instance, only performing a redraw after they're all done.
 T removeAllSeries(boolean redraw)
          A convenience method to run through and remove all of the series that are currently part of the chart instance, with explicit control over the animation options.
 boolean removeSeries(Series series)
          Remove the given series from the chart, automatically redrawing the chart after the series has been removed.
 boolean removeSeries(Series series, boolean redraw)
          Remove the given series from the chart, explicitly controlling whether or not the chart will be redrawn after the series is removed.
 T setAlignTicks(boolean alignTicks)
          Convenience method for setting the 'alignTicks' option of the chart.
 T setAnimation(Animation animation)
          Convenience method for setting the 'animation' options of the chart.
 T setAnimation(boolean animation)
          Convenience method for setting the 'animation' option of the chart.
 T setAreaPlotOptions(AreaPlotOptions areaPlotOptions)
          Updates the options that all area type series within the chart will use by default.
 T setAreaRangePlotOptions(AreaRangePlotOptions areaRangePlotOptions)
          Updates the options that all area range type series within the chart will use by default.
 T setAreaSplinePlotOptions(AreaSplinePlotOptions areaSplinePlotOptions)
          Updates the options that all area spline type series within the chart will use by default.
 T setAreaSplineRangePlotOptions(AreaSplineRangePlotOptions areaSplineRangePlotOptions)
          Updates the options that all area spline range type series within the chart will use by default.
 T setBackgroundColor(Color backgroundColor)
          Convenience method for setting the 'backgroundColor' option of the chart, allowing for colors with opacity or gradients.
 T setBackgroundColor(String backgroundColor)
          Convenience method for setting the 'backgroundColor' option of the chart to an RGB hex value.
 T setBarPlotOptions(BarPlotOptions barPlotOptions)
          Updates the options that all bar type series within the chart will use by default.
 T setBorderColor(Color borderColor)
          Convenience method for setting the 'borderColor' option of the chart, allowing for colors with opacity or gradients.
 T setBorderColor(String borderColor)
          Convenience method for setting the 'borderColor' option of the chart to an RGB hex value.
 T setBorderRadius(Number borderRadius)
          Convenience method for setting the 'borderRadius' option of the chart.
 T setBorderWidth(Number borderWidth)
          Convenience method for setting the 'borderWidth' option of the chart.
 T setBoxPlotOptions(BoxPlotOptions boxPlotOptions)
          Updates the options that all box type series within the chart will use by default.
 T setBubblePlotOptions(BubblePlotOptions bubblePlotOptions)
          Updates the options that all bubble type series within the chart will use by default.
 T setChartSubtitle(ChartSubtitle subtitle)
          Convenience method for setting the 'subtitle' chart options.
 T setChartSubtitleText(String subtitle)
          Convenience method for setting the 'subtitle/text' chart option.
 T setChartTitle(ChartTitle title)
          Convenience method for setting the 'title' chart options.
 T setChartTitleText(String title)
          Convenience method for setting the 'title/text' chart option.
 T setClassName(String className)
          Convenience method for setting the 'className' option of the chart.
 T setClickEventHandler(ChartClickEventHandler chartClickEventHandler)
          Set a callback handler that will be invoked whenever the user clicks on the plot background.
 T setColorAxis(ColorAxis colorAxis)
          Convenience method for setting the 'colorAxis' options of the chart.
 T setColors(String... colors)
          Sets the default colors for the chart's series.
 T setColumnPlotOptions(ColumnPlotOptions columnPlotOptions)
          Updates the options that all column type series within the chart will use by default.
 T setColumnRangePlotOptions(ColumnRangePlotOptions columnRangePlotOptions)
          Updates the options that all column range type series within the chart will use by default.
 T setCredits(Credits credits)
          Convenience method for setting the 'credits' options of the chart.
 T setErrorBarPlotOptions(ErrorBarPlotOptions errorBarPlotOptions)
          Updates the options that all errorBar type series within the chart will use by default.
 T setExporting(Exporting exporting)
          Convenience method for setting the 'exporting' options of the chart.
 T setFunnelPlotOptions(FunnelPlotOptions funnelPlotOptions)
          Updates the options that all funnel type series within the chart will use by default.
 T setGaugePlotOptions(GaugePlotOptions gaugePlotOptions)
          Updates the options that all funnel type series within the chart will use by default.
 T setHeatmapPlotOptions(HeatmapPlotOptions heatmapPlotOptions)
          Updates the options that all heatmap type series within the chart will use by default.
 T setHeight(Number height)
          Convenience method for setting the 'height' option of the chart.
 T setHeight100()
          A helper method which can be used to conveniently set the height of the DOM element that contains the chart to "100%".
 T setIgnoreHiddenSeries(boolean ignoreHiddenSeries)
          Convenience method for setting the 'ignoreHiddenSeries' option of the chart.
 T setInverted(boolean inverted)
          Convenience method for setting the 'inverted' option of the chart.
 T setLabelItems(LabelItem... labelItems)
          Sets HTML labels that can be positioned anywhere in the chart area.
 T setLabelsStyle(Style style)
          Sets the default CSS style options that will be shared by all label items that are added to the chart via the setLabelItems(LabelItem...) method.
 T setLegend(Legend legend)
          Convenience method for setting the 'legend' options of the chart.
 T setLinePlotOptions(LinePlotOptions linePlotOptions)
          Updates the options that all line type series within the chart will use by default.
 T setLoadEventHandler(ChartLoadEventHandler chartLoadEventHandler)
          Set a callback handler that will be invoked whenever the chart's loading event is fired.
 T setLoading(Loading loading)
          Convenience method for setting the 'loading' options of the chart.
 T setMargin(Number marginTop, Number marginRight, Number marginBottom, Number marginLeft)
          Convenience method for setting the 'margin' option of the chart.
 T setMarginBottom(Number marginBottom)
          Convenience method for setting the 'marginBottom' option of the chart.
 T setMarginLeft(Number marginLeft)
          Convenience method for setting the 'marginBottom' option of the chart.
 T setMarginRight(Number marginRight)
          Convenience method for setting the 'marginRight' option of the chart.
 T setMarginTop(Number marginTop)
          Convenience method for setting the 'marginTop' option of the chart.
 T setNavigation(Navigation navigation)
          Convenience method for setting the 'navigation' options of the chart, which represents a collection of options for buttons and menus appearing in the exporting module.
 T setOption(String path, Object value)
          General purpose method to set an arbitrary option on the chart at any level, using "/" characters to designate which level of option you'd like to set.
 T setPersistent(boolean persistent)
          By default the data associated with the series of the chart is only maintained within a GWT managed Java array until the chart is rendered, at which point the data points of the series are maintained exclusively within the DOM via the Highcharts API.
 T setPiePlotOptions(PiePlotOptions piePlotOptions)
          Updates the options that all pie type series within the chart will use by default.
 T setPinchType(BaseChart.PinchType pinchType)
          Sets which dimensions the user can zoom using multi-touch gestures.
 T setPlotBackgroundColor(Color plotBackgroundColor)
          Convenience method for setting the 'plotBackgroundColor' option of the chart, allowing for colors with opacity or gradients.
 T setPlotBackgroundColor(String plotBackgroundColor)
          Convenience method for setting the 'plotBackgroundColor' option of the chart to an RGB hex value.
 T setPlotBackgroundImage(String plotBackgroundImage)
          Convenience method for setting the 'plotBackgroundImage option of the chart.
 T setPlotBorderColor(Color plotBorderColor)
          Convenience method for setting the 'plotBorderColor' option of the chart, allowing for colors with opacity or gradients.
 T setPlotBorderColor(String plotBorderColor)
          Convenience method for setting the 'plotBorderColor' option of the chart to an RGB hex value.
 T setPlotBorderWidth(Number plotBorderWidth)
          Convenience method for setting the 'plotBorderWidth' option of the chart.
 T setPlotShadow(boolean plotShadow)
          Convenience method for setting the 'plotShadow' option of the chart.
 T setPolar(boolean polar)
          Convenience method to set the 'polar' option of the chart.
 T setPyramidPlotOptions(PyramidPlotOptions pyramidPlotOptions)
          Updates the options that all pie type series within the chart will use by default.
 T setRedrawEventHandler(ChartRedrawEventHandler chartRedrawEventHandler)
          Set a callback handler that will be invoked whenever the chart's redraw event is fired.
 T setReflow(boolean reflow)
          Convenience method for setting the 'reflow' option of the chart.
 T setResetZoomButton(ResetZoomButton resetZoomButton)
          Convenience method for adding the reset zoom button to the chart.
 T setScatterPlotOptions(ScatterPlotOptions scatterPlotOptions)
          Updates the options that all scatter type series within the chart will use by default.
 T setSelectionEventHandler(ChartSelectionEventHandler chartSelectionEventHandler)
          Set a callback handler that will be invoked whenever the chart's selection event is fired.
 T setSelectionMarkerFill(Color selectionMarkerFill)
          Convenience method for setting the 'plotBackgroundColor' option of the chart, allowing for colors with opacity.
 T setSelectionMarkerFill(String selectionMarkerFill)
          Convenience method for setting the 'selectionMarkerFill' option of the chart to an RGB hex value.
 T setSeriesPlotOptions(SeriesPlotOptions seriesPlotOptions)
          Updates the general options that all series within the chart will use by default.
 T setShadow(boolean shadow)
          Convenience method for setting the 'shadow' option of the chart.
 T setShowAxes(boolean showAxes)
          Convenience method for setting the 'showAxes' option of the chart.
 T setSize(int width, int height)
          Updates the size of the chart to match the given width and height, using the default animation options.
 T setSize(int width, int height, Animation animation)
          Updates the size of the chart to match the given width and height, allowing for custom control over how the animation will be resized.
 T setSize(int width, int height, boolean animated)
          Updates the size of the chart to match the given width and height, explicitly setting whether or not the resize should be animated.
 T setSizeToMatchContainer()
          Update the size of the chart to match the size of the container that this widget was inserted inside of.
 T setSolidGaugePlotOptions(SolidGaugePlotOptions solidGaugePlotOptions)
          Updates the options that all solidgauge type series within the chart will use by default.
 T setSpacingBottom(Number spacingBottom)
          Convenience method for setting the 'spacingBottom' option of the chart.
 T setSpacingLeft(Number spacingLeft)
          Convenience method for setting the 'spacingLeft' option of the chart.
 T setSpacingRight(Number spacingRight)
          Convenience method for setting the 'spacingRight' option of the chart.
 T setSpacingTop(Number spacingTop)
          Convenience method for setting the 'spacingTop' option of the chart.
 T setSplinePlotOptions(SplinePlotOptions splinePlotOptions)
          Updates the options that all spline type series within the chart will use by default.
 T setStyle(Style style)
          Convenience method for setting the 'style' options of the chart.
 T setSymbols(Marker.Symbol... symbols)
          Sets the default symbols for the series point markers.
 T setTitle(ChartTitle chartTitle, ChartSubtitle chartSubtitle)
          Set a new title or subtitle for the chart.
 T setToolTip(ToolTip toolTip)
          Convenience method for setting the 'tooltip' option of the chart.
 T setTreemapPlotOptions(TreemapPlotOptions treemapPlotOptions)
          Updates the options that all treemap type series within the chart will use by default.
 T setType(Series.Type type)
          Sets the defaults series type for the chart (which controls the way the series will be rendered), using an enumeration type in order to ensure a correct value is passed.
 T setWaterfallPlotOptions(WaterfallPlotOptions waterfallPlotOptions)
          Updates the options that all waterfall type series within the chart will use by default.
 T setWidth(Number width)
          Convenience method for setting the 'width' option of the chart.
 T setWidth100()
          A helper method which can be used to conveniently set the width of the DOM element that contains the chart to "100%".
 T setZoomType(BaseChart.ZoomType zoomType)
          Sets which dimensions the user can zoom by dragging the mouse.
 T showLoading(String message)
          Dim the chart's plot area and show a loading label text.
 
Methods inherited from class com.google.gwt.user.client.ui.Widget
addAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents
 
Methods inherited from class com.google.gwt.user.client.ui.UIObject
addStyleDependentName, addStyleName, ensureDebugId, ensureDebugId, ensureDebugId, getAbsoluteLeft, getAbsoluteTop, getElement, getOffsetHeight, getOffsetWidth, getStyleElement, getStyleName, getStyleName, getStylePrimaryName, getStylePrimaryName, getTitle, isVisible, isVisible, onEnsureDebugId, removeStyleDependentName, removeStyleName, resolvePotentialElement, setElement, setElement, setHeight, setPixelSize, setSize, setStyleDependentName, setStyleName, setStyleName, setStyleName, setStyleName, setStylePrimaryName, setStylePrimaryName, setTitle, setVisible, setVisible, setWidth, sinkBitlessEvent, toString, unsinkEvents
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

candlestickPlotOptions

protected CandlestickPlotOptions candlestickPlotOptions

ohlcPlotOptions

protected OHLCPlotOptions ohlcPlotOptions
Constructor Detail

BaseChart

protected BaseChart()
This class can not be created directly, but instead create an instance of one of the sub types such as Chart or StockChart.

Method Detail

setAlignTicks

public T setAlignTicks(boolean alignTicks)
Convenience method for setting the 'alignTicks' option of the chart. Equivalent to:

     chart.setOption("/chart/alignTicks", false);
 
When using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by setting alignTicks to false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by setting gridLineWidth to 0. Defaults to true.

Parameters:
alignTicks - The value to set as the 'alignTicks' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setAnimation

public T setAnimation(boolean animation)
Convenience method for setting the 'animation' option of the chart. Equivalent to:

     chart.setOption("/chart/animation", true);
 
Sets the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see PlotOptions.setAnimation(boolean) method for control over series animations that are added after the chart has been rendered.

Note that more control over the animations is available by calling the setAnimation(Animation) method instead.

Parameters:
animation - The value to set as the 'animation' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setAnimation

public T setAnimation(Animation animation)
Convenience method for setting the 'animation' options of the chart. Equivalent to code like:

     chart.setOption("/chart/animation/duration", 500);
     chart.setOption("/chart/animation/easing", "linear");
 
Sets the overall animation for all chart updating. Animation can be disabled throughout the chart by setting it to false here. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, see PlotOptions.setAnimation(Animation) method for control over series animations that are added after the chart has been rendered.

Note that this is intended for users that want to have finite control over the way animations behave. To simply enable/disable animations, you can use the setAnimation(boolean) method instead.

Parameters:
animation - The custom animation to set as the default animation type for the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBackgroundColor

public T setBackgroundColor(String backgroundColor)
Convenience method for setting the 'backgroundColor' option of the chart to an RGB hex value. Equivalent to:

     chart.setOption("/chart/backgroundColor", "#CCCCCC");
 
The RGB background color for the outer chart area. Defaults to "#FFFFFF".

Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setBackgroundColor(Color) version instead.

Parameters:
backgroundColor - The value to set as the 'backgroundColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBackgroundColor

public T setBackgroundColor(Color backgroundColor)
Convenience method for setting the 'backgroundColor' option of the chart, allowing for colors with opacity or gradients. Equivalent to:

     chart.setOption("/chart/backgroundColor", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The background color or gradient for the outer chart area. Defaults to "#FFFFFF".

Note that this method is intended for setting the color to a gradient or color that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setBackgroundColor(String) version instead.

Parameters:
backgroundColor - The color gradient or color with an alpha channel to set as the 'backgroundColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBorderColor

public T setBorderColor(String borderColor)
Convenience method for setting the 'borderColor' option of the chart to an RGB hex value. Equivalent to:

     chart.setOption("/chart/borderColor", "#CCCCCC");
 
The RGB color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners. Defaults to "#4572A7".

Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setBorderColor(Color) version instead.

Parameters:
borderColor - The value to set as the 'borderColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBorderColor

public T setBorderColor(Color borderColor)
Convenience method for setting the 'borderColor' option of the chart, allowing for colors with opacity or gradients. Equivalent to:

     chart.setOption("/chart/borderColor", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners. Defaults to "#4572A7".

Note that this method is intended for setting the color to a gradient or color that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setBorderColor(String) version instead.

Parameters:
borderColor - The color gradient or color with an alpha channel to set as the 'borderColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBorderRadius

public T setBorderRadius(Number borderRadius)
Convenience method for setting the 'borderRadius' option of the chart. Equivalent to:

     chart.setOption("/chart/borderRadius", 10);
 
The corner radius of the outer chart border. Defaults to 5.

Parameters:
borderRadius - The corner radius of the outer chart border.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBorderWidth

public T setBorderWidth(Number borderWidth)
Convenience method for setting the 'borderWidth' option of the chart. Equivalent to:

     chart.setOption("/chart/borderWidth", 10);
 
The pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners. Defaults to 0.

Parameters:
borderWidth - The corner radius of the outer chart border.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setChartSubtitleText

public T setChartSubtitleText(String subtitle)
Convenience method for setting the 'subtitle/text' chart option. Equivalent to:

     chart.setOption("/subtitle/text", "Source: Wikipedia.com");
 
The actual text of the chart subtitle. It can contain basic HTML text markup like <b>, <i> and spans with style. Defaults to null.

For more control over the title, utilize the setChartSubtitle(ChartSubtitle) method instead.

To hide the chart subtitle completely, simply set the text to null.

Note that this method is intended for handling configuring the chart's sub title area before the chart has been rendered, and has no affect if you invoke the method after the chart has been drawn to the DOM. If you do want to change the sub title (or title) of the chart dynamically after it has already been rendered, you can use the setTitle(ChartTitle, ChartSubtitle) method instead.

Parameters:
subtitle - Sets the subtitle of chart, or null to hide the subtitle.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setChartSubtitle

public T setChartSubtitle(ChartSubtitle subtitle)
Convenience method for setting the 'subtitle' chart options. Equivalent to:

     chart.setOption("/subtitle/text", "Source: Wikipedia.com");
     chart.setOption("/subtitle/align", ChartTitle.Align.Left);
     etc...
 

When you call this method it will overwrite any existing settings that have already been applied to the subtitle (e.g. if you had previously called the setChartSubtitleText(String) method that change will get overwritten by this call.)

If you just want to change the text of the subtitle, you can simply use the setChartSubtitleText(String) method instead.

Note that this method is intended for handling configuring the chart's sub title area before the chart has been rendered, and has no affect if you invoke the method after the chart has been drawn to the DOM. If you do want to change the sub title (or title) of the chart dynamically after it has already been rendered, you can use the setTitle(ChartTitle, ChartSubtitle) method instead.

Parameters:
subtitle - Sets the chart subtitle options, or null to hide the subtitle.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setChartTitleText

public T setChartTitleText(String title)
Convenience method for setting the 'title/text' chart option. Equivalent to:

     chart.setOption("/title/text", "Sales by Year");
 
The actual text of the chart title. It can contain basic HTML text markup like <b>, <i> and spans with style. Defaults to "Chart title".

For more control over the title, utilize the setChartTitle(ChartTitle) method instead.

To hide the chart title completely, simply set the text to null.

Note that this method is intended for handling configuring the chart's title area before the chart has been rendered, and has no affect if you invoke the method after the chart has been drawn to the DOM. If you do want to change the title (or sub title) of the chart dynamically after it has already been rendered, you can use the setTitle(ChartTitle, ChartSubtitle) method instead.

Parameters:
title - Sets the title of chart, or null to hide the title.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setChartTitle

public T setChartTitle(ChartTitle title)
Convenience method for setting the 'title' chart options. Equivalent to:

     chart.setOption("/title/text", "Sales by Year");
     chart.setOption("/title/align", ChartTitle.Align.Left);
     etc...
 

If you call this method it will overwrite any existing settings that have already been applied to the title (e.g. if you had previously called the setChartTitleText(String) method that change will get overwritten by this call.)

If you just want to change the text of the title, you can simply use the setChartTitleText(String) method instead.

Note that this method is intended for handling configuring the chart's title area before the chart has been rendered, and has no affect if you invoke the method after the chart has been drawn to the DOM. If you do want to change the title (or sub title) of the chart dynamically after it has already been rendered, you can use the setTitle(ChartTitle, ChartSubtitle) method instead.

Parameters:
title - Sets the chart title options, or null to hide the title.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setClassName

public T setClassName(String className)
Convenience method for setting the 'className' option of the chart. Equivalent to:

     chart.setOption("/chart/className", "RedChart");
 
A CSS class name to apply to the charts container div, allowing unique CSS styling for each chart. Defaults to "".

Parameters:
className - A CSS class name to apply to the charts container div.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setColors

public T setColors(String... colors)
Sets the default colors for the chart's series. When all colors are used, new colors are pulled from the start again. Note that the colors for each series can be overridden via the PlotOptions.setColor(String) mechanism.

Default colors are: "#2f7ed8", "#0d233a", "#8bbc21", "#910000", "#1aadce", "#492970", "#f28f43", "#77a1e5", "#c42525", "#a6c96a"

Note: in Highcharts 2.x, default colors were: "#4572A7", "#AA4643", "#89A54E", "#80699B", "#3D96AE", "#DB843D", "#92A8CD", "#A47D7C", "#B5CA92"

Parameters:
colors - An array of colors to use as the defaults for each series.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setColorAxis

public T setColorAxis(ColorAxis colorAxis)
Convenience method for setting the 'colorAxis' options of the chart. Equivalent to:

     chart.setOption("/colorAxis/min", 0);
     chart.setOption("/colorAxis/minColor", "#FFFFFF");
 

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

setCredits

public T setCredits(Credits credits)
Convenience method for setting the 'credits' options of the chart. Equivalent to:

     chart.setOption("/credits/text", "Presented by Snoopy");
     chart.setOption("/credits/href", "http://www.peanuts.com/");
     etc..
 
Highchart by default puts a credits label in the lower right corner of the chart. This can be changed using these options.

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

setExporting

public T setExporting(Exporting exporting)
Convenience method for setting the 'exporting' options of the chart. Equivalent to:

     chart.setOption("/exporting/enabled", true);
     chart.setOption("/exporting/width", 600);
     etc..
 
Note that the "exporting" module must be included in the page in order for the exporting options to apply. E.g.:

<script type="text/javascript" src="js/modules/exporting.js"></script>

Parameters:
exporting - The options to apply to the exporting area of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0
See Also:
setNavigation(Navigation)

setHeight

public T setHeight(Number height)
Convenience method for setting the 'height' option of the chart. Equivalent to:

     chart.setOption("/chart/height", 300);
 
An explicit height for the chart. By default the height is calculated from the offset height of the containing element. Defaults to null.

Parameters:
height - An explicit height for the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setIgnoreHiddenSeries

public T setIgnoreHiddenSeries(boolean ignoreHiddenSeries)
Convenience method for setting the 'ignoreHiddenSeries' option of the chart. Equivalent to:

     chart.setOption("/chart/ignoreHiddenSeries", false);
 
If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected. Defaults to true.

Parameters:
ignoreHiddenSeries - If true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setInverted

public T setInverted(boolean inverted)
Convenience method for setting the 'inverted' option of the chart. Equivalent to:

     chart.setOption("/inverted", true);
 
Whether to invert the axes so that the x axis is horizontal and y axis is vertical. When true, the x axis is reversed by default. If a bar plot is present in the chart, it will be inverted automatically. Defaults to false.

Parameters:
inverted - Whether to invert the axes so that the x axis is horizontal and y axis is vertical.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setLabelItems

public T setLabelItems(LabelItem... labelItems)
Sets HTML labels that can be positioned anywhere in the chart area. Each label can contain HTML as well as CSS style properties that can be used to position the label anywhere in the chart area. See the setLabelsStyle(Style) method to control the default style for each label.

Parameters:
labelItems - An array of LabelItem instances that contain the HTML of the label as well as a "style" object that can be used to position each label.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setLabelsStyle

public T setLabelsStyle(Style style)
Sets the default CSS style options that will be shared by all label items that are added to the chart via the setLabelItems(LabelItem...) method. The default label style is simply:

Parameters:
style - Shared CSS styles for all label items.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setLegend

public T setLegend(Legend legend)
Convenience method for setting the 'legend' options of the chart. Equivalent to:

     chart.setOption("/legend/borderColor", "#CCCCCC");
     chart.setOption("/legend/layout", Legend.Layout.HORIZONTAL);
     etc..
 
The legend is a box containing a symbol and name for each series item or point item in the chart.

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

setLoading

public T setLoading(Loading loading)
Convenience method for setting the 'loading' options of the chart. Equivalent to:

     chart.setOption("/loading/showDuration", 150);
     chart.setOption("/loading/hideDuration", 60);
     etc..
 
The loading options control the appearance of the loading screen that covers the plot area on chart operations. This screen only appears after an explicit call to showLoading(String). It is a utility for developers to communicate to the end user that something is going on, for example while retrieving new data via a GWT remoting request. The "Loading..." text itself is not part of this configuration object, but part of the Lang object.

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

setMargin

public T setMargin(Number marginTop,
                   Number marginRight,
                   Number marginBottom,
                   Number marginLeft)
Convenience method for setting the 'margin' option of the chart. Equivalent to:

     chart.setOption("/chart/margin", 0, 10, 0, 15);
 
The margin between the outer edge of the chart and the plot area. Use the options setMarginTop(Number), setMarginRight(Number), setMarginBottom(Number), and setMarginLeft(Number) for shorthand setting of one option.

Since version 2.1, the margin is 0 by default. The actual space is dynamically calculated from the offset of axis labels, axis title, title, subtitle and legend in addition to the setSpacingTop(Number), setSpacingRight(Number), setSpacingBottom(Number), and setSpacingLeft(Number) options.

Parameters:
marginTop - The margin between the top outer edge of the chart and the plot area.
marginRight - The margin between the right outer edge of the chart and the plot area.
marginBottom - The margin between the bottom outer edge of the chart and the plot area.
marginLeft - The margin between the left outer edge of the chart and the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setMarginTop

public T setMarginTop(Number marginTop)
Convenience method for setting the 'marginTop' option of the chart. Equivalent to:

     chart.setOption("/chart/marginTop", 100);
 
The margin between the top outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingTop(Number). Defaults to null.

Parameters:
marginTop - The margin between the top outer edge of the chart and the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setMarginRight

public T setMarginRight(Number marginRight)
Convenience method for setting the 'marginRight' option of the chart. Equivalent to:

     chart.setOption("/chart/marginRight", 100);
 
The margin between the right outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingRight(Number). Defaults to null.

Parameters:
marginRight - The margin between the right outer edge of the chart and the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setMarginBottom

public T setMarginBottom(Number marginBottom)
Convenience method for setting the 'marginBottom' option of the chart. Equivalent to:

     chart.setOption("/chart/marginBottom", 100);
 
The margin between the bottom outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingBottom(Number). Defaults to null.

Parameters:
marginBottom - The margin between the bottom outer edge of the chart and the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setMarginLeft

public T setMarginLeft(Number marginLeft)
Convenience method for setting the 'marginBottom' option of the chart. Equivalent to:

     chart.setOption("/chart/marginLeft", 100);
 
The margin between the left outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See also setSpacingLeft(Number). Defaults to null.

Parameters:
marginLeft - The margin between the left outer edge of the chart and the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setNavigation

public T setNavigation(Navigation navigation)
Convenience method for setting the 'navigation' options of the chart, which represents a collection of options for buttons and menus appearing in the exporting module.

Note that the "exporting" module must be included in the page in order for the exporting navigation options to apply. E.g.:

<script type="text/javascript" src="js/modules/navigation.js"></script>

Parameters:
navigation - The options to apply to the exporting navigation area of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0
See Also:
setExporting(Exporting)

setPinchType

public T setPinchType(BaseChart.PinchType pinchType)
Sets which dimensions the user can zoom using multi-touch gestures. Can be one of BaseChart.PinchType.X, BaseChart.PinchType.Y or BaseChart.PinchType.X_AND_Y. Defaults to null. Equivalent to:

     chart.setOption("/chart/pinchType", Chart.PinchType.X);
 
Equivalent to zoomType, but for multitouch gestures only. By default, the pinchType is the same as the zoomType setting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse drag pans the chart, while pinching is enabled. Defaults to null.

Parameters:
pinchType - One of the allowed pinch types
Returns:
A reference to this Chart instance for convenient method chaining.
Since:
1.6.0

setPlotBackgroundColor

public T setPlotBackgroundColor(String plotBackgroundColor)
Convenience method for setting the 'plotBackgroundColor' option of the chart to an RGB hex value. Equivalent to:

     chart.setOption("/chart/plotBackgroundColor", "#CCCCCC");
 
The RGB background color for the plot area. Defaults to null.

Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setPlotBackgroundColor(Color) version instead.

Parameters:
plotBackgroundColor - The value to set as the 'plotBackgroundColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPlotBackgroundColor

public T setPlotBackgroundColor(Color plotBackgroundColor)
Convenience method for setting the 'plotBackgroundColor' option of the chart, allowing for colors with opacity or gradients. Equivalent to:

     chart.setOption("/chart/plotBackgroundColor", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The background color or gradient for the plot area. Defaults to null.

Note that this method is intended for setting the color to a gradient or color that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setPlotBackgroundColor(String) version instead.

Parameters:
plotBackgroundColor - The color gradient or color with an alpha channel to set as the 'plotBackgroundColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPlotBackgroundImage

public T setPlotBackgroundImage(String plotBackgroundImage)
Convenience method for setting the 'plotBackgroundImage option of the chart. Equivalent to:

     chart.setOption("/chart/plotBackgroundImage", null)
 
To set an image as the background for the entire chart, set a CSS background image to the container element. Defaults to null.

Parameters:
plotBackgroundImage - The URL for an image to use as the plot background.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.6.0

setPlotBorderColor

public T setPlotBorderColor(String plotBorderColor)
Convenience method for setting the 'plotBorderColor' option of the chart to an RGB hex value. Equivalent to:

     chart.setOption("/chart/plotBorderColor", "#CCCCCC");
 
The RGB color of the inner chart or plot area border. Defaults to "#C0C0C0".

Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setPlotBorderColor(Color) version instead.

Parameters:
plotBorderColor - The value to set as the 'plotBorderColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPlotBorderColor

public T setPlotBorderColor(Color plotBorderColor)
Convenience method for setting the 'plotBorderColor' option of the chart, allowing for colors with opacity or gradients. Equivalent to:

     chart.setOption("/chart/plotBorderColor", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The color (or gradient) of the inner chart or plot area border. Defaults to "#C0C0C0".

Note that this method is intended for setting the color to a gradient or color that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setPlotBorderColor(String) version instead.

Parameters:
plotBorderColor - The color gradient or color with an alpha channel to set as the 'plotBorderColor' option on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPlotBorderWidth

public T setPlotBorderWidth(Number plotBorderWidth)
Convenience method for setting the 'plotBorderWidth' option of the chart. Equivalent to:

     chart.setOption("/chart/plotBorderWidth", 10);
 
The pixel width of the plot area border. Defaults to 0.

Parameters:
plotBorderWidth - The pixel width of the plot area border.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPolar

public T setPolar(boolean polar)
Convenience method to set the 'polar' option of the chart. Equivalent to:

     chart.setOption("/chart/polar", true);
 
When true, cartesian charts like line, spline, area and column are transformed into the polar coordinate system. Requires highcharts-more.js. Defaults to false.

Parameters:
polar - Whether to render the the chart using a polar coordinate system.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.6.0

setPlotShadow

public T setPlotShadow(boolean plotShadow)
Convenience method for setting the 'plotShadow' option of the chart. Equivalent to:

     chart.setOption("/chart/plotShadow", false);
 
Whether to apply a drop shadow to the plot area. Requires that plotBackgroundColor be set. Defaults to false.

Parameters:
plotShadow - Whether to apply a drop shadow to the plot area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setReflow

public T setReflow(boolean reflow)
Convenience method for setting the 'reflow' option of the chart. Equivalent to:

     chart.setOption("/chart/reflow", false);
 
Whether to reflow the chart to fit the width of the container div on resizing the window. Defaults to true.

Parameters:
reflow - If true, reflow the chart to fit the width of the container div on resizing the window.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setResetZoomButton

public T setResetZoomButton(ResetZoomButton resetZoomButton)
Convenience method for adding the reset zoom button to the chart. Equivalent to:
<>code>
     chart.setOption("/resetZoomButton"
 

Parameters:
resetZoomButton - The button that appears after a selection zoom, allowing the user to reset zoom.
Returns:
A reference to this Chart instance for convenient method chaining.
Since:
1.6.0

setSelectionMarkerFill

public T setSelectionMarkerFill(String selectionMarkerFill)
Convenience method for setting the 'selectionMarkerFill' option of the chart to an RGB hex value. Equivalent to:

     chart.setOption("/chart/selectionMarkerFill", "#4572a7");
 
The RGB color of the selection marker. Defaults to "#4572a7". Note that this method is intended for setting the color to a simple RBG hex value. If you instead want to set a color to include an alpha channel or a gradient, use the setSelectionMarkerFill(Color) version instead.

Parameters:
selectionMarkerFill - The background color of the marker square when selecting (zooming in on) an area of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.6.0

setSelectionMarkerFill

public T setSelectionMarkerFill(Color selectionMarkerFill)
Convenience method for setting the 'plotBackgroundColor' option of the chart, allowing for colors with opacity. Equivalent to:

     chart.setOption("/chart/selectionMarkerFill", rgba(69,114,167,0.25));
 
Note that this method is intended for setting the color to one that includes an alpha channel. If you instead just want to set the color to a normal RGB hex value you can use the setSelectionMarkerFill(String) version instead.

Parameters:
selectionMarkerFill - The color with an alpha channel to fil the marker square when selecting (zooming in on) an area of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.6.0

setShadow

public T setShadow(boolean shadow)
Convenience method for setting the 'shadow' option of the chart. Equivalent to:

     chart.setOption("/chart/shadow", true);
 
Whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set. Defaults to false.

Parameters:
shadow - If true, apply a drop shadow to the outer chart area.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setShowAxes

public T setShowAxes(boolean showAxes)
Convenience method for setting the 'showAxes' option of the chart. Equivalent to:

     chart.setOption("/chart/showAxes", true);
 
Whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes are automatically added to cartesian series. Defaults to false.

Parameters:
showAxes - If true, show the axes initially (only applies to empty charts when the series are added dynamically).
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSpacingTop

public T setSpacingTop(Number spacingTop)
Convenience method for setting the 'spacingTop' option of the chart. Equivalent to:

     chart.setOption("/chart/spacingTop", 100);
 
The space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). Defaults to 10.

Parameters:
spacingTop - The space between the top edge of the chart and the content.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSpacingRight

public T setSpacingRight(Number spacingRight)
Convenience method for setting the 'spacingRight' option of the chart. Equivalent to:

     chart.setOption("/chart/spacingRight", 100);
 
The space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). Defaults to 10.

Parameters:
spacingRight - The space between the right edge of the chart and the content.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSpacingBottom

public T setSpacingBottom(Number spacingBottom)
Convenience method for setting the 'spacingBottom' option of the chart. Equivalent to:

     chart.setOption("/chart/spacingBottom", 100);
 
The space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). Defaults to 15.

Parameters:
spacingBottom - The space between the bottom edge of the chart and the content.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSpacingLeft

public T setSpacingLeft(Number spacingLeft)
Convenience method for setting the 'spacingLeft' option of the chart. Equivalent to:

     chart.setOption("/chart/spacingLeft", 100);
 
The space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position). Defaults to 10.

Parameters:
spacingLeft - The space between the left edge of the chart and the content.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setStyle

public T setStyle(Style style)
Convenience method for setting the 'style' options of the chart. Equivalent to:

     chart.setOption("/chart/style/fontWeight", "bold");
     chart.setOption("/chart/style/fontFamily", "serif");
     etc.
 
Additional CSS styles to apply inline to the container div. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally. Defaults to:

Parameters:
style - An object containing the style properties to set on the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSymbols

public T setSymbols(Marker.Symbol... symbols)
Sets the default symbols for the series point markers. When all symbols are used, new symbols are pulled from the start again. Note that the symbols for each series can be overridden via the Marker.setSymbol(org.moxieapps.gwt.highcharts.client.plotOptions.Marker.Symbol) method (which can be set on the series via its plot options, see Series.setPlotOptions(org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions)).

Default symbols are: Circle, Diamond, Square, Triangle, and Triangle-Down

Parameters:
symbols - An array of symbols to use as the default symbols for the series point markers.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setTitle

public T setTitle(ChartTitle chartTitle,
                  ChartSubtitle chartSubtitle)
Set a new title or subtitle for the chart. This method can be called after the chart is rendered in order to change the title of the chart dynamically.

Note: this method is primarily intended to allow the chart's title or sub-title area to be modified dynamically, after the chart has already been rendered to the DOM. If you instead simply want to set the title or sub-title of the chart via normal configuration (before the chart has been rendered), then you can utilize the setChartTitleText(String), setChartTitle(ChartTitle), setChartSubtitleText(String) and setChartSubtitle(ChartSubtitle) methods.

Parameters:
chartTitle - The new options for the main title area of the chart (including the text).
chartSubtitle - The new options for the main subtitle area of the chart (including the text).
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0

setToolTip

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

     chart.setOption("/tooltip/borderColor", "#CCCCCC");
     chart.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 T setType(Series.Type type)
Sets the defaults series type for the chart (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:

     chart.setOption("/chart/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 BaseChart instance for convenient method chaining.

setWidth

public T setWidth(Number width)
Convenience method for setting the 'width' option of the chart. Equivalent to:

     chart.setOption("/chart/width", 800);
 
An explicit width for the chart. By default the width is calculated from the offset width of the containing element. Defaults to null.

Parameters:
width - An explicit width for the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSizeToMatchContainer

public T setSizeToMatchContainer()
Update the size of the chart to match the size of the container that this widget was inserted inside of.

Returns:
A reference to this BaseChart instance for convenient method chaining.

setWidth100

public T setWidth100()
A helper method which can be used to conveniently set the width of the DOM element that contains the chart to "100%". Note that for more precise control over the size of the chart see the setSize(int, int) and setSizeToMatchContainer() methods.

Returns:
A reference to this BaseChart instance for convenient method chaining.

setHeight100

public T setHeight100()
A helper method which can be used to conveniently set the height of the DOM element that contains the chart to "100%". Note that for more precise control over the size of the chart see the setSize(int, int) and setSizeToMatchContainer() methods.

Returns:
A reference to this BaseChart instance for convenient method chaining.

setSize

public T setSize(int width,
                 int height)
Updates the size of the chart to match the given width and height, using the default animation options. Note that if you simply want to set the size of the chart to match the container in which it was inserted, you can simply call the setSizeToMatchContainer() method instead.

Parameters:
width - The new pixel width of the chart.
height - The new pixel height of the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSize

public T setSize(int width,
                 int height,
                 boolean animated)
Updates the size of the chart to match the given width and height, explicitly setting whether or not the resize should be animated.

Parameters:
width - The new pixel width of the chart.
height - The new pixel height of the chart.
animated - When true, the resize will be animated with default animation options. The animation can also be configured by call the setSize(int, int, Animation) method instead.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSize

public T setSize(int width,
                 int height,
                 Animation animation)
Updates the size of the chart to match the given width and height, allowing for custom control over how the animation will be resized.

Parameters:
width - The new pixel width of the chart.
height - The new pixel height of the chart.
animation - The custom animation to use as the resize animation for the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setOption

public T setOption(String path,
                   Object value)
General purpose method to set an arbitrary option on the chart at any level, using "/" characters to designate which level of option you'd like to set. E.g., the following code:

 Chart chart = new Chart();
 chart.setOption("/chart/type", "spline");
 chart.setOption("/chart/marginRight", 10);
 chart.setOption("/title/text", "Nice Chart");
 
Would result in initializing HighCharts like the following:

 new HighCharts.Chart({
     chart: {
         type: "spline",
         marginRight: 10
     },
     title: {
         text: "Nice Chart"
     }
 });
 
Note that the beginning "/" is optional, so chart.setOption("/thing", "piglet") is equivalent to chart.setOption("thing", "piglet").

For details on available options see the Highcharts reference.

Note that, when possible, you'll ideally want to use one of the available type specific setter methods instead of this general method. E.g. instead of doing this:


 chart.setOption("/chart/type", "spline");
 
Do this instead:

 chart.setType(Series.Type.SPLINE);
 

Parameters:
path - The path to the option to set (e.g. "/title/text");
value - The value to set for the option (can be a String, Number, Boolean, or JSONObject)
Returns:
A reference to this BaseChart instance for convenient method chaining.

getOptions

public com.google.gwt.json.client.JSONObject getOptions()
Retrieve all of the options that have been configured for this chart instance as a JSONObject.

Returns:
A JSONObject representing all of the configuration options that have been set on the instance (will be null if no options have been set)
Since:
1.1.3

setAreaPlotOptions

public T setAreaPlotOptions(AreaPlotOptions areaPlotOptions)
Updates the options that all area type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
areaPlotOptions - The options to set on the chart as the default settings for all area type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setAreaRangePlotOptions

public T setAreaRangePlotOptions(AreaRangePlotOptions areaRangePlotOptions)
Updates the options that all area range type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Note that the highcharts-more.js script must be included in your GWT module to use AreaRange charts.

Parameters:
areaRangePlotOptions - The options to set on the chart as the default settings for all area range type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setAreaSplinePlotOptions

public T setAreaSplinePlotOptions(AreaSplinePlotOptions areaSplinePlotOptions)
Updates the options that all area spline type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
areaSplinePlotOptions - The options to set on the chart as the default settings for all area spline type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setAreaSplineRangePlotOptions

public T setAreaSplineRangePlotOptions(AreaSplineRangePlotOptions areaSplineRangePlotOptions)
Updates the options that all area spline range type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Note that the highcharts-more.js script must be included in your GWT module to use AreaSplineRange charts.

Parameters:
areaSplineRangePlotOptions - The options to set on the chart as the default settings for all area spline range type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBarPlotOptions

public T setBarPlotOptions(BarPlotOptions barPlotOptions)
Updates the options that all bar type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
barPlotOptions - The options to set on the chart as the default settings for all bar type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBoxPlotOptions

public T setBoxPlotOptions(BoxPlotOptions boxPlotOptions)
Updates the options that all box type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
boxPlotOptions - The options to set on the chart as the default settings for all box type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setBubblePlotOptions

public T setBubblePlotOptions(BubblePlotOptions bubblePlotOptions)
Updates the options that all bubble type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
bubblePlotOptions - The options set on the chart as the default settings for all bar type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setColumnPlotOptions

public T setColumnPlotOptions(ColumnPlotOptions columnPlotOptions)
Updates the options that all column type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
columnPlotOptions - The options to set on the chart as the default settings for all column type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setColumnRangePlotOptions

public T setColumnRangePlotOptions(ColumnRangePlotOptions columnRangePlotOptions)
Updates the options that all column range type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
columnRangePlotOptions - The options to set on the chart as the default settings for all column type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setErrorBarPlotOptions

public T setErrorBarPlotOptions(ErrorBarPlotOptions errorBarPlotOptions)
Updates the options that all errorBar type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
errorBarPlotOptions - The options to set on the chart as the default settings for all box type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setFunnelPlotOptions

public T setFunnelPlotOptions(FunnelPlotOptions funnelPlotOptions)
Updates the options that all funnel type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
funnelPlotOptions - The options to set on the chart as the default settings for all funnel type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setGaugePlotOptions

public T setGaugePlotOptions(GaugePlotOptions gaugePlotOptions)
Updates the options that all funnel type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
gaugePlotOptions - The options to set on the chart as the default settings for all funnel type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setHeatmapPlotOptions

public T setHeatmapPlotOptions(HeatmapPlotOptions heatmapPlotOptions)
Updates the options that all heatmap type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
heatmapPlotOptions - The options to set on the chart as the default settings for all heatmap type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setLinePlotOptions

public T setLinePlotOptions(LinePlotOptions linePlotOptions)
Updates the options that all line type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
linePlotOptions - The options to set on the chart as the default settings for all line type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPiePlotOptions

public T setPiePlotOptions(PiePlotOptions piePlotOptions)
Updates the options that all pie type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
piePlotOptions - The options to set on the chart as the default settings for all pie type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setPyramidPlotOptions

public T setPyramidPlotOptions(PyramidPlotOptions pyramidPlotOptions)
Updates the options that all pie type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plt options on a chart that has already been rendered will only affect series that are subseqiently addes to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
pyramidPlotOptions - The options to set on the chart as the default settings for all pyramid type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setSeriesPlotOptions

public T setSeriesPlotOptions(SeriesPlotOptions seriesPlotOptions)
Updates the general options that all series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that the general SeriesPlotOptions type only represents core options that area available for all series types. To control options that are more specific to each series type, use one of the more specific methods instead (e.g. setLinePlotOptions(org.moxieapps.gwt.highcharts.client.plotOptions.LinePlotOptions), setAreaPlotOptions(org.moxieapps.gwt.highcharts.client.plotOptions.AreaPlotOptions), etc.)

Also note that changing the general plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart, and therefore will not impact any of the series that are already rendered in the chart.

Parameters:
seriesPlotOptions - The options to set on the chart as the default settings for all series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setScatterPlotOptions

public T setScatterPlotOptions(ScatterPlotOptions scatterPlotOptions)
Updates the options that all scatter type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
scatterPlotOptions - The options to set on the chart as the default settings for all scatter type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setTreemapPlotOptions

public T setTreemapPlotOptions(TreemapPlotOptions treemapPlotOptions)
Updates the options that all treemap type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
treemapPlotOptions - The options to set on the chart as the default settings for all treemap type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setWaterfallPlotOptions

public T setWaterfallPlotOptions(WaterfallPlotOptions waterfallPlotOptions)
Updates the options that all waterfall type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
waterfallPlotOptions - The options to set on the chart as the default settings for all scatter type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setClickEventHandler

public T setClickEventHandler(ChartClickEventHandler chartClickEventHandler)
Set a callback handler that will be invoked whenever the user clicks on the plot background. Information where the user clicked can then be found through the ChartClickEvent instance that is passed to the handler's ChartClickEventHandler.onClick(org.moxieapps.gwt.highcharts.client.events.ChartClickEvent) method.

Parameters:
chartClickEventHandler - The handler that should be invoked whenever a click event occurs.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0

setLoadEventHandler

public T setLoadEventHandler(ChartLoadEventHandler chartLoadEventHandler)
Set a callback handler that will be invoked whenever the chart's loading event is fired.

Parameters:
chartLoadEventHandler - The handler that should be invoked whenever a load event occurs.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0

setRedrawEventHandler

public T setRedrawEventHandler(ChartRedrawEventHandler chartRedrawEventHandler)
Set a callback handler that will be invoked whenever the chart's redraw event is fired.

Parameters:
chartRedrawEventHandler - The handler that should be invoked whenever a redraw event occurs.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0

setSelectionEventHandler

public T setSelectionEventHandler(ChartSelectionEventHandler chartSelectionEventHandler)
Set a callback handler that will be invoked whenever the chart's selection event is fired.

Parameters:
chartSelectionEventHandler - The handler that should be invoked whenever a selection event occurs.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.1.0

setSolidGaugePlotOptions

public T setSolidGaugePlotOptions(SolidGaugePlotOptions solidGaugePlotOptions)
Updates the options that all solidgauge type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
solidGaugePlotOptions - the options to set on the chart as the default settings for all solidgauge type series that are part of this chart.
Returns:
@return A reference to this BaseChart instance for convenient method chaining.

setSplinePlotOptions

public T setSplinePlotOptions(SplinePlotOptions splinePlotOptions)
Updates the options that all spline type series within the chart will use by default. The settings can then be overridden for each individual series via the Series.setPlotOptions(PlotOptions) method.

Note that changing the plot options on a chart that has already been rendered will only affect series that are subsequently added to the chart (and will not impact any of the series that are already rendered in the chart.)

Parameters:
splinePlotOptions - The options to set on the chart as the default settings for all spline type series that are part of this chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

setZoomType

public T setZoomType(BaseChart.ZoomType zoomType)
Sets which dimensions the user can zoom by dragging the mouse. Can be one of BaseChart.ZoomType.X, BaseChart.ZoomType.Y or BaseChart.ZoomType.X_AND_Y. Defaults to null. This is equivalent to setting the option manually with code like:

     chart.setOption("/chart/zoomType", Chart.ZoomType.X);
 

Parameters:
zoomType - One of the allowed zoom types.
Returns:
A reference to this Chart instance for convenient method chaining.

isPersistent

public boolean isPersistent()
By default the data associated with the series of the chart is only maintained within a GWT managed Java array until the chart is rendered, at which point the data points of the series are maintained exclusively within the DOM via the Highcharts API. This is primarily intended for memory savings, to avoid having to keep the all of the data point information in two places. However, if you need to support dynamically moving a chart from one panel to another within the application you can set the persistent option to 'true', which will then retain the GWT managed Java array as well so that when the chart is redrawn in the new panel all of the data will still be available.

Returns:
'true' if the data associated with the points in the series in the chart will be retained locally within a GWT managed Java array (as well as within the DOM via the core Highcharts JS library). Defaults to 'false' for memory savings.
Since:
1.2.0

setPersistent

public T setPersistent(boolean persistent)
By default the data associated with the series of the chart is only maintained within a GWT managed Java array until the chart is rendered, at which point the data points of the series are maintained exclusively within the DOM via the Highcharts API. This is primarily intended for memory savings, to avoid having to keep the all of the data point information in two places. However, if you need to support dynamically moving a chart from one panel to another within the application you can set the persistent option to 'true', which will then retain the GWT managed Java array as well so that when the chart is redrawn in the new panel all of the data will still be available.

Parameters:
persistent - 'true' to retain the data associated with the points in the series in the chart locally within a GWT managed Java array (as well as within the DOM via the core Highcharts JS library). Defaults to 'false' for memory savings.
Returns:
A reference to this BaseChart instance for convenient method chaining.
Since:
1.2.0

createSeries

public Series createSeries()
Create a new data series that can be configured, and then added to this chart instance via the addSeries(Series) method.

Returns:
The series that was created (which will need to be added to the chart after it is configured via addSeries(Series).

addSeries

public T addSeries(Series series)
Add the given data series to the chart, using the default options. Note, see the addSeries(Series, boolean, boolean) and addSeries(Series, boolean, Animation) for more control over how the series will be drawn and animated when added to a chart that has already been rendered.

Parameters:
series - The data series to add to the chart, including its general configuration and plot options.
Returns:
A reference to this BaseChart instance for convenient method chaining.

addSeries

public T addSeries(Series series,
                   boolean redraw,
                   boolean animation)
Add a data series to this chart, controlling the redraw and animation options.

Parameters:
series - The data series to add to the chart, including its general configuration and plot options.
redraw - 'true' to force the chart to redraw immediately, or 'false' to wait until the redraw() method is invoked.
animation - When 'true', the series updating will be animated with default animation options. Note, use the addSeries(Series, boolean, Animation) method for more control over the animation options.
Returns:
A reference to this BaseChart instance for convenient method chaining.

addSeries

public T addSeries(Series series,
                   boolean redraw,
                   Animation animation)
Add a data series to this chart, controlling the redraw and animation options.

Parameters:
series - The data series to add to the chart, including its general configuration and plot options.
redraw - 'true' to force the chart to redraw immediately, or 'false' to wait until the redraw() method is invoked.
animation - Custom animation to use when the series is being updated.
Returns:
A reference to this BaseChart instance for convenient method chaining.

getSeries

public Series getSeries(String seriesId)
Retrieve the series instance within the chart for the given id, or null if no series exists in the chart with the given id. Note that series ids are set automatically by the framework, so all series instances are guaranteed to have an id associated with them.

Some event methods (such as SeriesEvent.getSeriesId()) return the unique id of a series, which can then be used in conjunction with this method to access the series instance associated with the event.

Parameters:
seriesId - The unique id of the series to try and find.
Returns:
The series associated with the given id, or null if no series exist with the given id
Since:
1.1.0

getSeries

public Series[] getSeries()
Return an array of all the Series instances that have been added to this chart (either before or after the chart was rendered), or an empty array if none have been added yet. Note that we're returning an array instead of a java.util.List as the generic interface types require a bit of a performance hit in GWT to use.

Returns:
An array of the Series instances currently within the chart, or an empty array if none have yet been added.

removeSeries

public boolean removeSeries(Series series)
Remove the given series from the chart, automatically redrawing the chart after the series has been removed. See the removeSeries(Series, boolean) method if you're performing multiple options on the chart at once and need tighter control over when the chart is redrawn.

Parameters:
series - The series instance to remove from the chart.
Returns:
'true' if the series was a part of this chart and successfully removed, or 'false' if the given series was not a part of this chart and therefore couldn't be removed.

removeSeries

public boolean removeSeries(Series series,
                            boolean redraw)
Remove the given series from the chart, explicitly controlling whether or not the chart will be redrawn after the series is removed.

Parameters:
series - The series instance to remove from the chart.
redraw - Whether to redraw the chart after the series is removed. When you're performing multiple options on the chart, it is highly recommended that the redraw option be set to false, and instead explicitly call the redraw() method after you're done updating the chart.
Returns:
'true' if the series was a part of this chart and successfully removed, or 'false' if the given series was not a part of this chart and therefore couldn't be removed.

removeAllSeries

public T removeAllSeries()
A convenience method to run through and remove all of the series that are currently part of the chart instance, only performing a redraw after they're all done. See the Series.remove() or removeSeries(Series) method if you instead want to remove a single series from the chart. Also see the removeAllSeries(boolean) method if you need more control over when the chart is redrawn.

Returns:
A reference to this BaseChart instance for convenient method chaining.

removeAllSeries

public T removeAllSeries(boolean redraw)
A convenience method to run through and remove all of the series that are currently part of the chart instance, with explicit control over the animation options. See the Series.remove() or removeSeries(Series) method if you instead want to remove a single series from the chart.

Parameters:
redraw - Whether to redraw the chart after the series is removed. When you're performing multiple options on the chart, it is highly recommended that the redraw option be set to false, and instead explicitly call the redraw() method after you're done updating the chart.
Returns:
A reference to this BaseChart instance for convenient method chaining.

getSelectedSeries

public Series[] getSelectedSeries()
Returns an array of all currently selected series in the chart. Series can be selected either programmatically by the Series.select(boolean) method or by checking the checkbox next to the legend item if the PlotOptions.setShowCheckbox(boolean) option is true.

Returns:
An array of the selected Series items, or an empty array if either no series are selected or the chart has not yet been rendered.
Since:
1.1.0

getSelectedPoints

public Point[] getSelectedPoints()
Returns an array of all currently selected points in the chart. Points can be selected either programmatically via the Point.select(boolean, boolean) method or by clicking on them.

Returns:
An array of the selected Point items, or an empty array if either no points are selected or the chart has not yet been rendered.
Since:
1.1.0

getSVG

public String getSVG()
Exporting module required. Get an SVG string representing the chart.

This method has no effect if the chart has not yet been rendered.

Returns:
An SVG representation of the chart, or null if the chart has not yet been rendered

hideLoading

public T hideLoading()
Hide the loading screen. Options for the loading screen are defined via setLoading(Loading). Should be used in conjunction with the showLoading(String) method.

This method has no effect if the chart has not yet been rendered.

Returns:
A reference to this BaseChart instance for convenient method chaining.

showLoading

public T showLoading(String message)
Dim the chart's plot area and show a loading label text. Options for the loading screen are defined via setLoading(Loading). A custom text can be given as a parameter, otherwise the default message specified via the Lang options will be used. Should be used in conjunction with the hideLoading() method.

This method has no effect if the chart has not yet been rendered.

Parameters:
message - A custom message to appear as the loading text.
Returns:
A reference to this BaseChart instance for convenient method chaining.

print

public T print()
Exporting module required. Clears away other elements in the page and prints the chart as it is displayed. By default, when the exporting module is enabled, a button at the upper left calls this method.

This method has no effect if the chart has not yet been rendered.

Returns:
A reference to this BaseChart instance for convenient method chaining.

getXAxis

public XAxis getXAxis()
Retrieve a reference to the XAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have one x-axis to operate on. If you have multiple x-axis, then utilize the getXAxis(int) method instead.

Returns:
A reference to the XAxis for this chart (never null);

getXAxis

public XAxis getXAxis(int axisIndex)
Retrieve a reference to a specific XAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have multiple x-axis to operate on. If you have only a single y-axis, then utilize the getXAxis() method instead.

Parameters:
axisIndex - The numeric index (zero based) of the XAxis to return.
Returns:
A reference to the XAxis at the given index for this chart (never null).

getYAxis

public YAxis getYAxis()
Retrieve a reference to the YAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have one y-axis to operate on. If you have multiple y-axis, then utilize the getYAxis(int) method instead.

Returns:
A reference to the YAxis for this chart (never null);

getYAxis

public YAxis getYAxis(int axisIndex)
Retrieve a reference to a specific YAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have multiple y-axis to operate on. If you have only a single y-axis, then utilize the getYAxis() method instead.

Parameters:
axisIndex - The numeric index (zero based) of the YAxis to return.
Returns:
A reference to the YAxis at the given index for this chart (never null).

getZAxis

public ZAxis getZAxis()
Retrieve a reference to the ZAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have one y-axis to operate on. If you have multiple y-axis, then utilize the getZAxis(int) method instead.

Returns:
A reference to the YAxis for this chart (never null);

getZAxis

public ZAxis getZAxis(int axisIndex)
Retrieve a reference to a specific ZAxis for this chart (guaranteed non-null), so that it can then be configured or operated on. Note that you should use this method when you only have multiple y-axis to operate on. If you have only a single y-axis, then utilize the getZAxis() method instead.

Parameters:
axisIndex - The numeric index (zero based) of the YAxis to return.
Returns:
A reference to the ZAxis at the given index for this chart (never null).

getNativeChart

public com.google.gwt.core.client.JavaScriptObject getNativeChart()
Returns a pointer to the native Highcharts or Highstock chart instance that this GWT BaseChart instance is associated with. Note that this method will only return a non-null value if it is called after the chart has been rendered. For advanced use-cases only.

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

redraw

public T redraw()
Redraw the chart after changes have been done to the data or axis extremes. All methods for updating axes, series or points have a parameter for redrawing the chart. This is true by default. But in many cases you want to do more than one operation on the chart before redrawing, for example add a number of points. In those cases it is a waste of resources to redraw the chart for each new point added. So you add the points and call redraw() after.

The redraw() method only redraws those parts of the chart that are actually changed. If the data of a series is changed and it doesn't affect the axes, only the series itself is redrawn. If the new data requires the axis extremes to be altered, the axis and all other series depending on it are redrawn.

Returns:
A reference to this BaseChart instance for convenient method chaining.

reflow

public T reflow()
Reflows the chart to its container. By default, the chart reflows automatically to its container following a window.resize event, as per the setReflow(boolean) option. However, there are no reliable events for div resize, so if the container is resized without a window resize event, this must be called explicitly.

The redraw() method only redraws those parts of the chart that are actually changed. If the data of a series is changed and it doesn't affect the axes, only the series itself is redrawn. If the new data requires the axis extremes to be altered, the axis and all other series depending on it are redrawn.

Returns:
A reference to this BaseChart instance for convenient method chaining.

isRendered

public boolean isRendered()
Returns true if the chart has already been rendered to the DOM, or false otherwise.

Returns:
'true' if the chart has been rendered to the DOM

onLoad

protected void onLoad()
Overrides:
onLoad in class com.google.gwt.user.client.ui.Widget

getChartTypeName

protected abstract String getChartTypeName()
To be overridden in a sub class to return the JS type name of the chart instance that should be created when the chart is rendered. E.g. "Chart", "StockChart", etc.

Returns:
The name of the JS class type that should be created when this chart is rendered.

onUnload

protected void onUnload()
Overrides:
onUnload in class com.google.gwt.user.client.ui.Widget

convertSeriesToJSON

protected com.google.gwt.json.client.JSONObject convertSeriesToJSON(Series series)


Copyright © 2015. All Rights Reserved.