|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.user.client.ui.UIObject com.google.gwt.user.client.ui.Widget org.moxieapps.gwt.highcharts.client.BaseChart<T>
public abstract class BaseChart<T>
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.
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 |
---|
protected CandlestickPlotOptions candlestickPlotOptions
protected OHLCPlotOptions ohlcPlotOptions
Constructor Detail |
---|
protected BaseChart()
Chart
or StockChart
.
Method Detail |
---|
public T setAlignTicks(boolean alignTicks)
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.
alignTicks
- The value to set as the 'alignTicks' option on the chart.
BaseChart
instance for convenient method chaining.public T setAnimation(boolean animation)
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.
animation
- The value to set as the 'animation' option on the chart.
BaseChart
instance for convenient method chaining.public T setAnimation(Animation animation)
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.
animation
- The custom animation to set as the default animation type for the chart.
BaseChart
instance for convenient method chaining.public T setBackgroundColor(String backgroundColor)
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.
backgroundColor
- The value to set as the 'backgroundColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setBackgroundColor(Color backgroundColor)
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.
backgroundColor
- The color gradient or color with an alpha channel to set as the 'backgroundColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setBorderColor(String borderColor)
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.
borderColor
- The value to set as the 'borderColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setBorderColor(Color borderColor)
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.
borderColor
- The color gradient or color with an alpha channel to set as the 'borderColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setBorderRadius(Number borderRadius)
chart.setOption("/chart/borderRadius", 10);
The corner radius of the outer chart border. Defaults to 5.
borderRadius
- The corner radius of the outer chart border.
BaseChart
instance for convenient method chaining.public T setBorderWidth(Number borderWidth)
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.
borderWidth
- The corner radius of the outer chart border.
BaseChart
instance for convenient method chaining.public T setChartSubtitleText(String subtitle)
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.
subtitle
- Sets the subtitle of chart, or null to hide the subtitle.
BaseChart
instance for convenient method chaining.public T setChartSubtitle(ChartSubtitle subtitle)
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.
subtitle
- Sets the chart subtitle options, or null to hide the subtitle.
BaseChart
instance for convenient method chaining.public T setChartTitleText(String title)
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.
title
- Sets the title of chart, or null to hide the title.
BaseChart
instance for convenient method chaining.public T setChartTitle(ChartTitle title)
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.
title
- Sets the chart title options, or null to hide the title.
BaseChart
instance for convenient method chaining.public T setClassName(String className)
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 "".
className
- A CSS class name to apply to the charts container div.
BaseChart
instance for convenient method chaining.public T setColors(String... colors)
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"
colors
- An array of colors to use as the defaults for each series.
BaseChart
instance for convenient method chaining.public T setColorAxis(ColorAxis colorAxis)
chart.setOption("/colorAxis/min", 0);
chart.setOption("/colorAxis/minColor", "#FFFFFF");
colorAxis
- The options to apply to the colorAxis portion of the chart.
BaseChart
instance for convenient method chaining.public T setCredits(Credits credits)
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.
credits
- The options to apply to the credits area of the chart.
BaseChart
instance for convenient method chaining.public T setExporting(Exporting exporting)
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>
exporting
- The options to apply to the exporting area of the chart.
BaseChart
instance for convenient method chaining.setNavigation(Navigation)
public T setHeight(Number height)
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.
height
- An explicit height for the chart.
BaseChart
instance for convenient method chaining.public T setIgnoreHiddenSeries(boolean ignoreHiddenSeries)
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.
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.
BaseChart
instance for convenient method chaining.public T setInverted(boolean inverted)
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.
inverted
- Whether to invert the axes so that the x axis is horizontal and y axis is vertical.
BaseChart
instance for convenient method chaining.public T setLabelItems(LabelItem... labelItems)
setLabelsStyle(Style)
method to control the default style for
each label.
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.
BaseChart
instance for convenient method chaining.public T setLabelsStyle(Style style)
setLabelItems(LabelItem...)
method. The default label style
is simply:
style
- Shared CSS styles for all label items.
BaseChart
instance for convenient method chaining.public T setLegend(Legend legend)
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.
legend
- The options to apply to the legend of the chart.
BaseChart
instance for convenient method chaining.public T setLoading(Loading loading)
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.
loading
- The options to apply to the loading area of the chart.
BaseChart
instance for convenient method chaining.public T setMargin(Number marginTop, Number marginRight, Number marginBottom, Number marginLeft)
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.
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.
BaseChart
instance for convenient method chaining.public T setMarginTop(Number marginTop)
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.
marginTop
- The margin between the top outer edge of the chart and the plot area.
BaseChart
instance for convenient method chaining.public T setMarginRight(Number marginRight)
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.
marginRight
- The margin between the right outer edge of the chart and the plot area.
BaseChart
instance for convenient method chaining.public T setMarginBottom(Number marginBottom)
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.
marginBottom
- The margin between the bottom outer edge of the chart and the plot area.
BaseChart
instance for convenient method chaining.public T setMarginLeft(Number marginLeft)
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.
marginLeft
- The margin between the left outer edge of the chart and the plot area.
BaseChart
instance for convenient method chaining.public T setNavigation(Navigation navigation)
navigation
- The options to apply to the exporting navigation area of the chart.
BaseChart
instance for convenient method chaining.setExporting(Exporting)
public T setPinchType(BaseChart.PinchType pinchType)
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.
pinchType
- One of the allowed pinch types
Chart
instance for convenient method chaining.public T setPlotBackgroundColor(String plotBackgroundColor)
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.
plotBackgroundColor
- The value to set as the 'plotBackgroundColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setPlotBackgroundColor(Color plotBackgroundColor)
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.
plotBackgroundColor
- The color gradient or color with an alpha channel to set as the 'plotBackgroundColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setPlotBackgroundImage(String plotBackgroundImage)
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.
plotBackgroundImage
- The URL for an image to use as the plot background.
BaseChart
instance for convenient method chaining.public T setPlotBorderColor(String plotBorderColor)
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.
plotBorderColor
- The value to set as the 'plotBorderColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setPlotBorderColor(Color plotBorderColor)
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.
plotBorderColor
- The color gradient or color with an alpha channel to set as the 'plotBorderColor' option on the chart.
BaseChart
instance for convenient method chaining.public T setPlotBorderWidth(Number plotBorderWidth)
chart.setOption("/chart/plotBorderWidth", 10);
The pixel width of the plot area border. Defaults to 0.
plotBorderWidth
- The pixel width of the plot area border.
BaseChart
instance for convenient method chaining.public T setPolar(boolean polar)
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.
polar
- Whether to render the the chart using a polar coordinate system.
BaseChart
instance for convenient method chaining.public T setPlotShadow(boolean plotShadow)
chart.setOption("/chart/plotShadow", false);
Whether to apply a drop shadow to the plot area. Requires that plotBackgroundColor be set. Defaults to false.
plotShadow
- Whether to apply a drop shadow to the plot area.
BaseChart
instance for convenient method chaining.public T setReflow(boolean reflow)
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.
reflow
- If true, reflow the chart to fit the width of the container div on resizing
the window.
BaseChart
instance for convenient method chaining.public T setResetZoomButton(ResetZoomButton resetZoomButton)
<>code> chart.setOption("/resetZoomButton"
resetZoomButton
- The button that appears after a selection zoom, allowing the user to reset zoom.
Chart
instance for convenient method chaining.public T setSelectionMarkerFill(String selectionMarkerFill)
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.
selectionMarkerFill
- The background color of the marker square when selecting (zooming in on) an area of the chart.
BaseChart
instance for convenient method chaining.public T setSelectionMarkerFill(Color selectionMarkerFill)
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.
selectionMarkerFill
- The color with an alpha channel to fil the marker square when selecting (zooming in on) an area of the chart.
BaseChart
instance for convenient method chaining.public T setShadow(boolean shadow)
chart.setOption("/chart/shadow", true);
Whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set. Defaults to false.
shadow
- If true, apply a drop shadow to the outer chart area.
BaseChart
instance for convenient method chaining.public T setShowAxes(boolean showAxes)
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.
showAxes
- If true, show the axes initially (only applies to empty charts when the series
are added dynamically).
BaseChart
instance for convenient method chaining.public T setSpacingTop(Number spacingTop)
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.
spacingTop
- The space between the top edge of the chart and the content.
BaseChart
instance for convenient method chaining.public T setSpacingRight(Number spacingRight)
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.
spacingRight
- The space between the right edge of the chart and the content.
BaseChart
instance for convenient method chaining.public T setSpacingBottom(Number spacingBottom)
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.
spacingBottom
- The space between the bottom edge of the chart and the content.
BaseChart
instance for convenient method chaining.public T setSpacingLeft(Number spacingLeft)
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.
spacingLeft
- The space between the left edge of the chart and the content.
BaseChart
instance for convenient method chaining.public T setStyle(Style style)
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:
style
- An object containing the style properties to set on the chart.
BaseChart
instance for convenient method chaining.public T setSymbols(Marker.Symbol... symbols)
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
symbols
- An array of symbols to use as the default symbols for the series point markers.
BaseChart
instance for convenient method chaining.public T setTitle(ChartTitle chartTitle, ChartSubtitle chartSubtitle)
setChartTitleText(String)
,
setChartTitle(ChartTitle)
, setChartSubtitleText(String)
and
setChartSubtitle(ChartSubtitle)
methods.
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).
BaseChart
instance for convenient method chaining.public T setToolTip(ToolTip toolTip)
chart.setOption("/tooltip/borderColor", "#CCCCCC");
chart.setOption("/tooltip/shadow", true);
etc..
The tooltip appears when the user hovers over a series or point.
toolTip
- The options to apply to the tooltip of the chart.
BaseChart
instance for convenient method chaining.public T setType(Series.Type type)
chart.setOption("/chart/type", "line");
Note that if you don't set this explicitly the default series type is Series.Type.LINE
.
type
- One of the supported series types.
BaseChart
instance for convenient method chaining.public T setWidth(Number width)
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.
width
- An explicit width for the chart.
BaseChart
instance for convenient method chaining.public T setSizeToMatchContainer()
BaseChart
instance for convenient method chaining.public T setWidth100()
setSize(int, int)
and setSizeToMatchContainer()
methods.
BaseChart
instance for convenient method chaining.public T setHeight100()
setSize(int, int)
and setSizeToMatchContainer()
methods.
BaseChart
instance for convenient method chaining.public T setSize(int width, int height)
setSizeToMatchContainer()
method instead.
width
- The new pixel width of the chart.height
- The new pixel height of the chart.
BaseChart
instance for convenient method chaining.public T setSize(int width, int height, boolean animated)
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.
BaseChart
instance for convenient method chaining.public T setSize(int width, int height, Animation animation)
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.
BaseChart
instance for convenient method chaining.public T setOption(String path, Object value)
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);
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)
BaseChart
instance for convenient method chaining.public com.google.gwt.json.client.JSONObject getOptions()
public T setAreaPlotOptions(AreaPlotOptions areaPlotOptions)
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.)
areaPlotOptions
- The options to set on the chart as the default settings for all area type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setAreaRangePlotOptions(AreaRangePlotOptions areaRangePlotOptions)
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.
areaRangePlotOptions
- The options to set on the chart as the default settings for all area range type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setAreaSplinePlotOptions(AreaSplinePlotOptions areaSplinePlotOptions)
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.)
areaSplinePlotOptions
- The options to set on the chart as the default settings for all area spline type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setAreaSplineRangePlotOptions(AreaSplineRangePlotOptions areaSplineRangePlotOptions)
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.
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.
BaseChart
instance for convenient method chaining.public T setBarPlotOptions(BarPlotOptions barPlotOptions)
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.)
barPlotOptions
- The options to set on the chart as the default settings for all bar type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setBoxPlotOptions(BoxPlotOptions boxPlotOptions)
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.)
boxPlotOptions
- The options to set on the chart as the default settings for all box type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setBubblePlotOptions(BubblePlotOptions bubblePlotOptions)
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.)
bubblePlotOptions
- The options set on the chart as the default settings for all bar type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setColumnPlotOptions(ColumnPlotOptions columnPlotOptions)
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.)
columnPlotOptions
- The options to set on the chart as the default settings for all column type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setColumnRangePlotOptions(ColumnRangePlotOptions columnRangePlotOptions)
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.)
columnRangePlotOptions
- The options to set on the chart as the default settings for all column type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setErrorBarPlotOptions(ErrorBarPlotOptions errorBarPlotOptions)
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.)
errorBarPlotOptions
- The options to set on the chart as the default settings for all box type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setFunnelPlotOptions(FunnelPlotOptions funnelPlotOptions)
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.)
funnelPlotOptions
- The options to set on the chart as the default settings for all funnel type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setGaugePlotOptions(GaugePlotOptions gaugePlotOptions)
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.)
gaugePlotOptions
- The options to set on the chart as the default settings for all funnel type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setHeatmapPlotOptions(HeatmapPlotOptions heatmapPlotOptions)
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.)
heatmapPlotOptions
- The options to set on the chart as the default settings for all heatmap type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setLinePlotOptions(LinePlotOptions linePlotOptions)
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.)
linePlotOptions
- The options to set on the chart as the default settings for all line type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setPiePlotOptions(PiePlotOptions piePlotOptions)
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.)
piePlotOptions
- The options to set on the chart as the default settings for all pie type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setPyramidPlotOptions(PyramidPlotOptions pyramidPlotOptions)
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.)
pyramidPlotOptions
- The options to set on the chart as the default settings for all pyramid type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setSeriesPlotOptions(SeriesPlotOptions seriesPlotOptions)
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.
seriesPlotOptions
- The options to set on the chart as the default settings for all series that are part of this chart.
BaseChart
instance for convenient method chaining.public T setScatterPlotOptions(ScatterPlotOptions scatterPlotOptions)
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.)
scatterPlotOptions
- The options to set on the chart as the default settings for all scatter type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setTreemapPlotOptions(TreemapPlotOptions treemapPlotOptions)
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.)
treemapPlotOptions
- The options to set on the chart as the default settings for all treemap type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setWaterfallPlotOptions(WaterfallPlotOptions waterfallPlotOptions)
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.)
waterfallPlotOptions
- The options to set on the chart as the default settings for all scatter type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setClickEventHandler(ChartClickEventHandler chartClickEventHandler)
ChartClickEvent
instance
that is passed to the handler's ChartClickEventHandler.onClick(org.moxieapps.gwt.highcharts.client.events.ChartClickEvent)
method.
chartClickEventHandler
- The handler that should be invoked whenever a click event occurs.
BaseChart
instance for convenient method chaining.public T setLoadEventHandler(ChartLoadEventHandler chartLoadEventHandler)
chartLoadEventHandler
- The handler that should be invoked whenever a load event occurs.
BaseChart
instance for convenient method chaining.public T setRedrawEventHandler(ChartRedrawEventHandler chartRedrawEventHandler)
chartRedrawEventHandler
- The handler that should be invoked whenever a redraw event occurs.
BaseChart
instance for convenient method chaining.public T setSelectionEventHandler(ChartSelectionEventHandler chartSelectionEventHandler)
chartSelectionEventHandler
- The handler that should be invoked whenever a selection event occurs.
BaseChart
instance for convenient method chaining.public T setSolidGaugePlotOptions(SolidGaugePlotOptions solidGaugePlotOptions)
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.)
solidGaugePlotOptions
- the options to set on the chart as the default settings for all solidgauge type
series that are part of this chart.
BaseChart
instance for convenient method chaining.public T setSplinePlotOptions(SplinePlotOptions splinePlotOptions)
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.)
splinePlotOptions
- The options to set on the chart as the default settings for all spline type series
that are part of this chart.
BaseChart
instance for convenient method chaining.public T setZoomType(BaseChart.ZoomType zoomType)
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);
zoomType
- One of the allowed zoom types.
Chart
instance for convenient method chaining.public boolean isPersistent()
public T setPersistent(boolean persistent)
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.
BaseChart
instance for convenient method chaining.public Series createSeries()
addSeries(Series)
method.
addSeries(Series)
.public T addSeries(Series series)
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.
series
- The data series to add to the chart, including its general configuration and plot options.
BaseChart
instance for convenient method chaining.public T addSeries(Series series, boolean redraw, boolean animation)
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.
BaseChart
instance for convenient method chaining.public T addSeries(Series series, boolean redraw, Animation animation)
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.
BaseChart
instance for convenient method chaining.public Series getSeries(String seriesId)
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.
seriesId
- The unique id of the series to try and find.
public Series[] getSeries()
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.
public boolean removeSeries(Series series)
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.
series
- The series instance to remove from the chart.
public boolean removeSeries(Series series, boolean redraw)
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.
public T removeAllSeries()
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.
BaseChart
instance for convenient method chaining.public T removeAllSeries(boolean redraw)
Series.remove()
or
removeSeries(Series)
method if you instead want to remove a single series 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.
BaseChart
instance for convenient method chaining.public Series[] getSelectedSeries()
Series.select(boolean)
method or by checking the checkbox next to the legend item if the
PlotOptions.setShowCheckbox(boolean)
option is true.
public Point[] getSelectedPoints()
Point.select(boolean, boolean)
method or by clicking on them.
public String getSVG()
public T hideLoading()
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.
BaseChart
instance for convenient method chaining.public T showLoading(String message)
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.
message
- A custom message to appear as the loading text.
BaseChart
instance for convenient method chaining.public T print()
BaseChart
instance for convenient method chaining.public XAxis getXAxis()
getXAxis(int)
method instead.
public XAxis getXAxis(int axisIndex)
getXAxis()
method instead.
axisIndex
- The numeric index (zero based) of the XAxis to return.
public YAxis getYAxis()
getYAxis(int)
method instead.
public YAxis getYAxis(int axisIndex)
getYAxis()
method instead.
axisIndex
- The numeric index (zero based) of the YAxis to return.
public ZAxis getZAxis()
getZAxis(int)
method instead.
public ZAxis getZAxis(int axisIndex)
getZAxis()
method instead.
axisIndex
- The numeric index (zero based) of the YAxis to return.
public com.google.gwt.core.client.JavaScriptObject getNativeChart()
public T redraw()
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.
BaseChart
instance for convenient method chaining.public T reflow()
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.
BaseChart
instance for convenient method chaining.public boolean isRendered()
protected void onLoad()
onLoad
in class com.google.gwt.user.client.ui.Widget
protected abstract String getChartTypeName()
protected void onUnload()
onUnload
in class com.google.gwt.user.client.ui.Widget
protected com.google.gwt.json.client.JSONObject convertSeriesToJSON(Series series)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |