|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.user.client.ui.UIObject
com.google.gwt.user.client.ui.Widget
org.moxieapps.gwt.highcharts.client.BaseChart<StockChart>
org.moxieapps.gwt.highcharts.client.StockChart
public class StockChart
The main GWT widget that can be constructed and then configured in order to add a Highstock
chart into a GWT layout container. Note that for more basic chart types just make use of the
Chart
widget instead.
Basic usage is as follows:
StockChart stockChart = new StockChart()
.setChartTitleText("NYSE")
.setMarginRight(10);
Series series = stockChart.createSeries()
.addPoint(40)
.addPoint(35)
.addPoint(60);
stockChart.addSeries(series);
RootPanel.get().add(stockChart);
For details on available options see the Highcharts reference.
Note that in order for this widget to function you must have included the Highstock 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/highstock.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 the "highstock.js" file includes all of the capabilities of the "highcharts.js" file.
So if you plan on using both StockChart
's and regular Chart
's simultaneously, then
you only need to include the "highstock.js" file in your page.
Also 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 |
---|
Nested classes/interfaces inherited from class org.moxieapps.gwt.highcharts.client.BaseChart |
---|
BaseChart.PinchType, BaseChart.ZoomType |
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 | |
---|---|
StockChart()
Create a new Highstock 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. |
Navigator |
getNavigator()
Access the StockChart's Navigator , for customization. |
StockChart |
setCandlestickPlotOptions(CandlestickPlotOptions candlestickPlotOptions)
Updates the options that all candlestick type series within the chart will use by default. |
StockChart |
setOHLCPlotOptions(OHLCPlotOptions ohlcPlotOptions)
Updates the options that all OHLC type series within the chart will use by default. |
StockChart |
setRangeSelector(RangeSelector rangeSelector)
Convenience method for setting the 'rangeSelector' chart options. |
StockChart |
setScrollbar(Scrollbar scrollbar)
Convenience method for setting the 'scrollbar' chart options. |
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 StockChart()
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:
StockChart chart = new StockChart()
.setChartTitleText("Nice Chart")
.setMarginRight(10);
RootPanel.get().add(chart);
Method Detail |
---|
protected String getChartTypeName()
BaseChart
getChartTypeName
in class BaseChart<StockChart>
public Navigator getNavigator()
Navigator
, for customization.
Navigator
public StockChart setRangeSelector(RangeSelector rangeSelector)
stockChart.setOption("/rangeSelector/selected", 1);
stockChart.setOption("/rangeSelector/inputEnabled", false);
etc...
rangeSelector
- Sets the chart range selector options.
StockChart
instance for convenient method chaining.public StockChart setScrollbar(Scrollbar scrollbar)
stockChart.setOption("/scrollbar/enabled", false);
stockChart.setOption("/scrollbar/height", 2);
etc...
scrollbar
- Sets the scrollbar options
StockChart
instance for convenient method chaining.public StockChart setOHLCPlotOptions(OHLCPlotOptions ohlcPlotOptions)
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.)
ohlcPlotOptions
- The options to set on the chart as the default settings for all OHLC type series
that are part of this chart.
StockChart
instance for convenient method chaining.public StockChart setCandlestickPlotOptions(CandlestickPlotOptions candlestickPlotOptions)
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.)
candlestickPlotOptions
- The options to set on the chart as the default settings for all candlestick type series
that are part of this chart.
StockChart
instance for convenient method chaining.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |