public class Chart extends BaseChart<Chart>
StockChart for other available chart types.
Basic usage is as follows:
Chart chart = new Chart()
.setType(Series.Type.SPLINE)
.setChartTitleText("Nice Chart")
.setMarginRight(10);
Series series = chart.createSeries()
.addPoint(40)
.addPoint(35)
.addPoint(60);
chart.addSeries(series);
RootPanel.get().add(chart);
For details on available options see the Highcharts reference.
Note that in order for this widget to function you must have included the Highcharts javascript
library and any of its dependencies in the page that the widget will run inside of. E.g.:
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="js/highcharts.js"></script>
<!-- Optionally, add a highcharts theme file -->
<script type="text/javascript" src="js/themes/gray.js"></script>
<!-- Optionally, include the highcharts exporting module -->
<script type="text/javascript" src="js/modules/exporting.js"></script>
Note that Highcharts supports other JS frameworks besides jQuery for its internal DOM manipulation
functionality. So, if jQuery isn't your cup of tea check the
installation docs
on the Highcharts site for more details.| Modifier and Type | Class and Description |
|---|---|
static class |
Chart.PanKey
An enumeration of the known supported keys which are passed to the
setPanKey(PanKey)used as
a "panKey" which, when down, switches from zooming to panning. |
static class |
Chart.ZoomType
An enumeration of supported chart zoom types, which can be passed to the
setZoomType(ZoomType) method. |
BaseChart.PinchTypecandlestickPlotOptions, ohlcPlotOptions| Constructor and Description |
|---|
Chart()
Create a new Highcharts chart instance as a GWT Widget that can then be added to
a GWT layout like any other widget.
|
| Modifier and Type | Method and Description |
|---|---|
protected 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.
|
Chart |
setDrilldown(Drilldown drilldown)
Convenience method for setting the 'drilldown' options for the chart which represents a collection of options
that apply to standard charts.
|
Chart |
setNoData(NoData noData)
Convenience method for setting the 'noData' option of the chart.
|
Chart |
setOptions3D(Options3D options3d)
Convenience method for setting the 'options3d' options for the chart, which represents a collection of options
that apply only to standard charts.
|
Chart |
setPane(Pane pane)
Convenience method for setting the 'pane' options of the chart, which represents
a collection of options that apply only to polar charts and angular gauges.
|
Chart |
setPanKey(Chart.PanKey panKey)
Convenience method for setting the 'panKey' option of the chart.
|
Chart |
setPanning(Boolean panning)
Convenience method for setting the 'panning' option of the chart.
|
Chart |
setPolar(boolean polar)
Convenience method for setting the 'polar' option of the chart.
|
Chart |
setZoomType(Chart.ZoomType zoomType)
Deprecated.
|
addSeries, addSeries, addSeries, convertSeriesToJSON, createSeries, getNativeChart, getOptions, getSelectedPoints, getSelectedSeries, getSeries, getSeries, getSVG, getXAxis, getXAxis, getYAxis, getYAxis, getZAxis, getZAxis, hideLoading, isPersistent, isRendered, onLoad, onUnload, print, redraw, reflow, removeAllSeries, removeAllSeries, removeSeries, removeSeries, setAlignTicks, setAnimation, setAnimation, setAreaPlotOptions, setAreaRangePlotOptions, setAreaSplinePlotOptions, setAreaSplineRangePlotOptions, setBackgroundColor, setBackgroundColor, setBarPlotOptions, setBorderColor, setBorderColor, setBorderRadius, setBorderWidth, setBoxPlotOptions, setBubblePlotOptions, setChartSubtitle, setChartSubtitleText, setChartTitle, setChartTitleText, setClassName, setClickEventHandler, setColorAxis, setColors, setColumnPlotOptions, setColumnRangePlotOptions, setCredits, setErrorBarPlotOptions, setExporting, setFunnelPlotOptions, setGaugePlotOptions, setHeatmapPlotOptions, setHeight, setHeight100, setIgnoreHiddenSeries, setInverted, setLabelItems, setLabelsStyle, setLegend, setLinePlotOptions, setLoadEventHandler, setLoading, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setNavigation, setOption, setPersistent, setPiePlotOptions, setPinchType, setPlotBackgroundColor, setPlotBackgroundColor, setPlotBackgroundImage, setPlotBorderColor, setPlotBorderColor, setPlotBorderWidth, setPlotShadow, setPyramidPlotOptions, setRedrawEventHandler, setReflow, setResetZoomButton, setScatterPlotOptions, setSelectionEventHandler, setSelectionMarkerFill, setSelectionMarkerFill, setSeriesPlotOptions, setShadow, setShowAxes, setSize, setSize, setSize, setSizeToMatchContainer, setSolidGaugePlotOptions, setSpacingBottom, setSpacingLeft, setSpacingRight, setSpacingTop, setSplinePlotOptions, setStyle, setSymbols, setTitle, setToolTip, setTreemapPlotOptions, setType, setWaterfallPlotOptions, setWidth, setWidth100, setZoomType, showLoadingaddAttachHandler, addBitlessDomHandler, addDomHandler, addHandler, asWidget, asWidgetOrNull, createHandlerManager, delegateEvent, doAttachChildren, doDetachChildren, fireEvent, getHandlerCount, getLayoutData, getParent, isAttached, isOrWasAttached, onAttach, onBrowserEvent, onDetach, removeFromParent, setLayoutData, sinkEvents, unsinkEventsaddStyleDependentName, 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, toStringpublic Chart()
BaseChart.setType(org.moxieapps.gwt.highcharts.client.Series.Type),
BaseChart.setBackgroundColor(String), BaseChart.setOption(String, Object), etc.)
then support method chaining, allowing for syntax like the following:
Chart chart = new Chart()
.setType(Series.Type.SPLINE)
.setChartTitleText("Nice Chart")
.setMarginRight(10);
RootPanel.get().add(chart);
public Chart setDrilldown(Drilldown drilldown)
drilldown - The drilldown options to apply to the chart.Chart instance for convenient method chaining.public Chart setNoData(NoData noData)
noData - The noData options to apply to the chart.Chart instance for convenient method chaining.public Chart setOptions3D(Options3D options3d)
options3d - The 3D options to apply to the chart.Chart instance for convenient method chaining.public Chart setPane(Pane pane)
pane - The pane options to apply to the chart.Chart instance for convenient method chaining.public Chart setPanKey(Chart.PanKey panKey)
chart.setOption("panKey", "shift");
Allows setting a key to switch between zooming and panning.panKey - the key used to switch zooming to panning.Chart instance for convenient method chaining.public Chart setPanning(Boolean panning)
chart.setOption("panning", true);
Allow panning in a chart. Best used with panKey to combine zooming and panning. Defaults to false.panning - the value to set as the 'panning' option on the chart.Chart instance for convenient method chaining.public Chart 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. Defaults to false.
Note: this option is only available if the highcharts-more.js script is included in your GWT module.
public Chart setZoomType(Chart.ZoomType zoomType)
BaseChart.setZoomType(BaseChart.ZoomType)Chart.ZoomType.X, Chart.ZoomType.Y or
Chart.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.protected String getChartTypeName()
BaseChartgetChartTypeName in class BaseChart<Chart>Copyright © 2015. All Rights Reserved.