public class StockChart extends BaseChart<StockChart>
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.BaseChart.PinchType, BaseChart.ZoomTypecandlestickPlotOptions, ohlcPlotOptions| Constructor and Description |
|---|
StockChart()
Create a new Highstock 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.
|
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.
|
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, setPolar, 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 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);
protected String getChartTypeName()
BaseChartgetChartTypeName in class BaseChart<StockChart>public Navigator getNavigator()
Navigator, for customization.Navigatorpublic 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 optionsStockChart 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.Copyright © 2015. All Rights Reserved.