|
||||||||||
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<Chart> org.moxieapps.gwt.highcharts.client.Chart
public class Chart
The main GWT widget that can be constructed and then configured in order to add a Highcharts
chart into a GWT layout container. Note that only standard chart types can be created with
this widget. See the 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.
Nested Class Summary | |
---|---|
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. |
Nested classes/interfaces inherited from class org.moxieapps.gwt.highcharts.client.BaseChart |
---|
BaseChart.PinchType |
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 |
---|
Fields inherited from class org.moxieapps.gwt.highcharts.client.BaseChart |
---|
candlestickPlotOptions, ohlcPlotOptions |
Fields inherited from class com.google.gwt.user.client.ui.UIObject |
---|
DEBUG_ID_PREFIX |
Constructor Summary | |
---|---|
Chart()
Create a new Highcharts chart instance as a GWT Widget that can then be added to a GWT layout like any other widget. |
Method Summary | |
---|---|
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. Use BaseChart.setZoomType(BaseChart.ZoomType) |
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 |
Constructor Detail |
---|
public 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);
Method Detail |
---|
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.
setPolar
in class BaseChart<Chart>
polar
- The value to set as the 'polar' option on the chart.
Chart
instance for convenient method chaining.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()
BaseChart
getChartTypeName
in class BaseChart<Chart>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |