|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.moxieapps.gwt.highcharts.client.Configurable<T>
org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions<T>
public abstract class PlotOptions<T extends PlotOptions>
Represents the base class of all PlotOptions types. This class should not be used directly, but instead
use one of the sub types such as AreaPlotOptions
, BarPlotOptions
, etc. Note that general
plot options that should apply to all series can be set using the SeriesPlotOptions
. Also note
that plot options can be overridden on each individual series via the Series.setPlotOptions(PlotOptions)
mechanism.
Nested Class Summary | |
---|---|
static class |
PlotOptions.Cursor
An enumeration of supported cursor types, which can be passed to the setCursor(org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions.Cursor) method. |
static class |
PlotOptions.PointPlacement
An enumeration of the supported placement types, which can be passed to the setPointPlacement(org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions.PointPlacement) method. |
static class |
PlotOptions.Stacking
An enumeration of supported stacking types, which can be passed to the setStacking(PlotOptions.Stacking) method. |
Constructor Summary | |
---|---|
PlotOptions()
|
Method Summary | |
---|---|
BaseDataLabels |
getDataLabels()
Returns a reference to the data labels configuration that was set on this plot options, or null if none were set. |
T |
setAllowPointSelect(boolean allowPointSelect)
Convenience method for setting the 'allowPointSelect' plot option. |
T |
setAnimation(Animation animation)
Convenience method for setting the 'animation' plot option, controlling the details of the animation more precisely. |
T |
setAnimation(boolean animation)
Convenience method for setting the 'animation' plot option. |
protected T |
setBaseDataLabels(BaseDataLabels baseDataLabels)
|
T |
setColor(Color color)
Convenience method for setting the 'color' plot option to a gradient or color with an alpha value. |
T |
setColor(String color)
Convenience method for setting the 'color' plot option to an RGB value. |
T |
setCropThreshold(Number cropThreshold)
Convenience method for setting the 'cropThreshold' option. |
T |
setCursor(PlotOptions.Cursor cursor)
Convenience method for setting the 'cursor' plot option. |
T |
setDashStyle(PlotLine.DashStyle dashStyle)
Convenience method for setting the 'dashStyle' plot option. |
T |
setDataGrouping(DataGrouping dataGrouping)
Convenience method for setting the "dataGrouping" options for a stock chart. |
T |
setDataLabels(DataLabels dataLabels)
Convenience method for setting the 'dataLabels' plot option. |
T |
setEnableMouseTracking(boolean enableMouseTracking)
Convenience method for setting the 'enableMouseTracking' plot option. |
T |
setHoverStateEnabled(boolean enabled)
Convenience method for setting the 'enabled' plot option for the hover state. |
T |
setHoverStateLineWidth(Number lineWidth)
Convenience method for setting the 'lineWidth' plot option for the hover state. |
T |
setHoverStateMarker(Marker marker)
Convenience method for setting the 'marker' plot options for the hover state. |
T |
setId(String id)
Convenience method for setting the 'id' option of the chart. |
T |
setLegendIndex(int legendIndex)
Convenience method for setting the 'legendIndex' option of the plot options. |
T |
setLineWidth(Number lineWidth)
Convenience method for setting the 'lineWidth' plot option. |
T |
setLinkedTo(Series series)
convenience method for setting the "linkedTo" option. |
T |
setLinkedTo(String linkedTo)
convenience method for setting the "linkedTo" option. |
T |
setMarker(Marker marker)
Convenience method for setting the 'marker' plot options. |
PlotOptions |
setNegativeColor(Color negativeColor)
Convenience method for setting the "negativeColor" option for the plot options. |
PlotOptions |
setNegativeColor(String negativeColor)
Convenience method for setting the "negativeColor" option for the plot options. |
T |
setPointInterval(Number pointInterval)
Convenience method for setting the 'pointInterval' plot option. |
T |
setPointPlacement(PlotOptions.PointPlacement pointPointPlacement)
Convenience method for setting the 'pointPointPlacement' plot option. |
T |
setPointStart(Number pointStart)
Convenience method for setting the 'pointStart' plot option. |
T |
setSelected(boolean selected)
Convenience method for setting the 'selected' plot option. |
T |
setShadow(boolean shadow)
Convenience method for setting the 'shadow' plot option. |
T |
setShowCheckbox(boolean showCheckbox)
Convenience method for setting the 'showCheckbox' plot option. |
T |
setShowInLegend(boolean showInLegend)
Convenience method for setting the 'showInLegend' plot option. |
T |
setStacking(PlotOptions.Stacking stacking)
Convenience method for setting the 'stacking' plot option. |
T |
setStickyTracking(boolean stickyTracking)
Convenience method for setting the 'stickyTracking' plot option. |
T |
setThreshold(Number threshold)
Convenience method for setting the "threshold" option for the plot options. |
T |
setTurboThreshold(Number turboThreshold)
Convenience method for setting the "turboThreshold" optioin for the plot options. |
T |
setVisible(boolean visible)
Convenience method for setting the 'visible' plot option. |
T |
setZIndex(Number zIndex)
Convenience method for setting the 'zIndex' plot option. |
T |
setZoneAxis(Zone.Axis zoneAxis)
Convenience method for setting the 'zoneAxis' plot option. |
T |
setZones(Zone... zones)
Convenience method for setting the 'zone' plot option. |
Methods inherited from class org.moxieapps.gwt.highcharts.client.Configurable |
---|
getOptions, setOption |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PlotOptions()
Method Detail |
---|
public T setAllowPointSelect(boolean allowPointSelect)
plotOptions.setOption("allowPointSelect", true);
Allow the series' points to be selected by clicking on the markers, bars or pie slices.
Defaults to false.
allowPointSelect
- 'true' to allow the series' points to be selected by clicking on the markers.
PlotOptions
instance for convenient method chaining.public T setAnimation(boolean animation)
plotOptions.setOption("animation", true);
Enable or disable the initial animation when a series is displayed. Note that for more
control over the way the series display animations will occurs utils the setAnimation(org.moxieapps.gwt.highcharts.client.Animation)
method instead.
animation
- 'true' to animate series when they are added to the chart
PlotOptions
instance for convenient method chaining.public T setAnimation(Animation animation)
plotOptions.setOption("/animation/duration", 500);
plotOptions.setOption("/animation/easing", "linear");
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.
PlotOptions
instance for convenient method chaining.public T setColor(String color)
plotOptions.setOption("color", "#CC0000");
The main color of the series. In line type series it applies to the line and the point markers
unless otherwise specified. In bar type series it applies to the bars unless a color is specified
per point.
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 setColor(Color)
version instead.
Also note that the default colors for all of the series in the chart can be set via the
BaseChart.setColors(String...)
method.
color
- The color to use for this series (e.g. "#CC0000")
PlotOptions
instance for convenient method chaining.public T setColor(Color color)
chart.setOption("color", new Color()
.setLinearGradient(0.0, 0.0, 1.0, 1.0)
.addStop(new Color(255, 255, 255))
.addStop(new Color(200, 200, 255))
);
The main color of the series as a gradient or color with an alpha channel. In line type series it
applies to the line and the point markers unless otherwise specified. In bar type series it applies
to the bars unless a color is specified per point.
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 setColor(String)
version instead.
Also note that the default colors for all of the series in the chart can be set via the
BaseChart.setColors(String...)
method.
color
- The color to use for this series (e.g. "#CC0000")
PlotOptions
instance for convenient method chaining.public T setCropThreshold(Number cropThreshold)
plotOptions.setOption("crpThreshold", 25);
When the series contains less points than the crop threshold, all points are drawn, even if the points fall
outside the visible plot area at the current zoom. The advantage of drawing all points (including markers and
columns), is that animation is performed on updates. On the other hand, when the series contains more points
than the crop threshold, the series data is cropped to only contain points that fall within the plot area. The
advantage of cropping away invisible points is to increase performance on large series. Defaults to 50.
cropThreshold
- The limit of points to be displayed at any one time
PlotOptions
instance for convenient method chaining.public T setCursor(PlotOptions.Cursor cursor)
plotOptions.setOption("cursor", PlotOptions.Cursor.POINTER);
Tou can set the cursor to "pointer" if you have click events attached to the series, to signal
to the user that the points and lines can be clicked. Defaults to PlotOptions.Cursor.NONE.
cursor
- The color to use for this series (e.g. "#CC0000"), or null to use the default.
PlotOptions
instance for convenient method chaining.public T setDashStyle(PlotLine.DashStyle dashStyle)
plotOptions.setOption("dashStyle", PlotOptions.DashStyle.DOT);
A name for the dash style to use for the graph. Applies only to series type having a graph,
like line, spline, area and scatter in case it has a lineWidth. See this
demonstration for a visible reference
of the available dash styles.
dashStyle
- The dash style to use for this series, or null to use the default.
PlotOptions
instance for convenient method chaining.public T setDataLabels(DataLabels dataLabels)
plotOptions.setOption("/dataLabels/enabled", true);
plotOptions.setOption("/dataLabels/align", Labels.Align.CENTER);
plotOptions.setOption("/dataLabels/color", "#CC0000");
etc...
Defines the appearance of the data labels, static labels for each point.
Sample usage:
plotOptions.setDataLabels(
new DataLabels()
.setColor("#FF0000")
);
dataLabels
- The configuration of how the data labels should appear.
PlotOptions
instance for convenient method chaining.protected T setBaseDataLabels(BaseDataLabels baseDataLabels)
public T setDataGrouping(DataGrouping dataGrouping)
plotOptions.setDataGrouping(
new DataGrouping()
.setEnabled(true);
);
dataGrouping
- The dataGrouping options set using DataGrouping
PlotOptions
for convenient method chaining.public BaseDataLabels getDataLabels()
BaseDataLabels
and not simply
a DataLabels
in order to handle alternative labels types such as
ProportionalDataLabels
.
public T setEnableMouseTracking(boolean enableMouseTracking)
plotOptions.setOption("enableMouseTracking", false);
Enable or disable the mouse tracking for a specific series. This includes point tooltips
and click events on graphs and points. For large datasets it improves performance. Defaults to true.
enableMouseTracking
- Enable or disable the mouse tracking for a specific series.
PlotOptions
instance for convenient method chaining.public T setId(String id)
chart.setOption("id", "chart");
This can be used after render time to get a pointer to the series object through chart.get().
id
- An id for the series.
PlotOptions
instance for convenient method chaining.public T setLegendIndex(int legendIndex)
plotOptions.setOption("legendIndex", 3);
The sequential index of the series in the legend. Series default to being added to the
legend in the same index as they are added to the chart.
legendIndex
- The sequential index of the series in the legend.
PlotOptions
instance for convenient method chaining.public T setLineWidth(Number lineWidth)
plotOptions.setOption("lineWidth", 4);
Pixel with of the graph line. Defaults to 2.
lineWidth
- Pixel with of the graph line.
PlotOptions
instance for convenient method chaining.public T setLinkedTo(String linkedTo)
plotOptions.setOption("linkedTo", "seriesId");
The id of another series to link to. Additionally, the value can be ":previous" to link to the previous series.
When two series are linked, only the first one appears in the legend.
Toggling the visibility of this also toggles the linked series.
Note: this method will set a link to another series based on its id. To link to the series itself instead of its
id, use setLinkedTo(Series)
linkedTo
- The name of the series to be linked to.
PlotOptions
instance for convenient method chaining.setLinkedTo(Series)
public T setLinkedTo(Series series)
plotOptions.setOption("linkedTo", "seriesId");
The id of another series to link to. Additionally, the value can be ":previous" to link to the previous series.
When two series are linked, only the first one appears in the legend.
Toggling the visibility of this also toggles the linked series.
series
- The name of the series to be linked to.
PlotOptions
instance for convenient method chaining.setLinkedTo(String)
public T setMarker(Marker marker)
plotOptions.setOption("/marker/enabled", true);
plotOptions.setOption("/marker/fillColor", "#CCCCCC");
plotOptions.setOption("/dataLabels/radius", 4);
etc...
Defines the appearance of the markers drawn for this series.
marker
- The configuration of how the series markers should appear.
PlotOptions
instance for convenient method chaining.public PlotOptions setNegativeColor(Color negativeColor)
areaPlotOptions.setOption("negativeColor", new Color()
.setLinearGradient(0.0, 0.0, 1.0, 1.0)
.addStop(new Color(255, 255, 255))
.addStop(new Color(200, 200, 255))
);
When a point's Z value is below the zThreshold setting, this color is used. 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 setNegativeColor(String)
version instead.
negativeColor
- The color for the parts of the graph or points that are below the threshold.
PlotOptions
instance for convenient method chaining.public PlotOptions setNegativeColor(String negativeColor)
PlotOptions.setOptions("negativeColor", "#CCCCCC");
When a point's Z value is below the zThreshold setting, this color is used. 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 setNegativeColor(Color)
version instead.
negativeColor
- The color for the parts of the graph or points that are below the threshold.
PlotOptions
instance for convenient method chaining.public T setPointStart(Number pointStart)
plotOptions.setOption("pointStart", 10);
If no x values are given for the points in a series, pointStart defines on what value to
start. For example, if a series contains one yearly value starting from 1945,
set pointStart to 1945. Defaults to 0.
pointStart
- Which value to start the series at.
PlotOptions
instance for convenient method chaining.public T setPointInterval(Number pointInterval)
plotOptions.setOption("pointInterval", 5);
If no x values are given for the points in a series, pointInterval defines the
interval of the x values. For example, if a series contains one value every decade
starting from year 0, set pointInterval to 10.
pointInterval
- The interval of the x value in the series.
PlotOptions
instance for convenient method chaining.public T setPointPlacement(PlotOptions.PointPlacement pointPointPlacement)
plotOptions.setOption("pointPointPlacement", Stacking.NULL);
Possible values: null, "on", "between".
In a column chart, when pointPointPlacement is "on", the point will not create any padding of the X axis.
In a polar column chart this means that the first column points directly north.
If the pointPointPlacement is "between", the columns will be laid out between ticks.
This is useful for example for visualising an amount between two points in time or in a certain sector of a polar chart.
Defaults to null in cartesian charts, "between" in polar charts.
pointPointPlacement
- Where to place points in relation to ticks on the axis.
PlotOptions
instance for convenient method chaining.public T setSelected(boolean selected)
plotOptions.setOption("selected", true);
Whether to select the series initially. If setShowCheckbox(boolean)
is true,
the checkbox next to the series name will be checked for a selected series. Defaults to false.
selected
- Whether to select the series initially.
PlotOptions
instance for convenient method chaining.public T setShadow(boolean shadow)
plotOptions.setOption("shadow", false);
Whether to apply a drop shadow to the graph line. Defaults to true.
shadow
- Whether to apply a drop shadow to the graph line.
PlotOptions
instance for convenient method chaining.public T setShowCheckbox(boolean showCheckbox)
plotOptions.setOption("showCheckbox", true);
If true, a checkbox is displayed next to the legend item to allow selecting the series.
The state of the checkbox is determined by the selected option. Defaults to false.
showCheckbox
- Whether to display next to the legend item to allow selecting the series.
PlotOptions
instance for convenient method chaining.public T setShowInLegend(boolean showInLegend)
plotOptions.setOption("showInLegend", false);
Whether to display this particular series or series type in the legend. Defaults to true.
showInLegend
- Whether to display this particular series or series type in the legend.
PlotOptions
instance for convenient method chaining.public T setStacking(PlotOptions.Stacking stacking)
plotOptions.setOption("stacking", Stacking.NORMAL);
Whether to stack the values of each series on top of each other. Possible values are null to disable,
"normal" to stack by value or "percent". Defaults to null.
stacking
- Whether to stack the values of each series on top of each other.
PlotOptions
instance for convenient method chaining.public T setHoverStateEnabled(boolean enabled)
plotOptions.setOption("/states/hover/enable", true);
Enable separate styles for the hovered series to visualize that the user hovers either the
series itself or the legend. Enabling it has a performance penalty as it requires that a second
layer be drawn as a double buffer. This means twice as much graphics to draw for each plot,
which can make a great difference for charts with a high number of series or points. Defaults to false.
enabled
- Whether to enable separate styles for the hover state.
PlotOptions
instance for convenient method chaining.public T setHoverStateLineWidth(Number lineWidth)
plotOptions.setOption("/states/hover/lineWidth", 4);
Pixel with of the graph line when hovered over. Defaults to 2.
lineWidth
- Pixel with of the graph line when hovered over.
PlotOptions
instance for convenient method chaining.public T setHoverStateMarker(Marker marker)
plotOptions.setOption("/states/hover/marker/enabled", true);
plotOptions.setOption("/states/hover/marker/fillColor", "#CCCCCC");
plotOptions.setOption("/states/hover/dataLabels/radius", 4);
etc...
Defines the appearance of the markers drawn for this series when hovered over. Note that the
hover state need to be enabled with the setHoverStateEnabled(boolean)
method in order
for this option to have any effect.
marker
- The configuration of how the series markers should appear when hover over.
PlotOptions
instance for convenient method chaining.public T setStickyTracking(boolean stickyTracking)
plotOptions.setOption("stickyTracking", false);
Sticky tracking of mouse events. When true, the mouseOut event on a series isn't triggered
until the mouse moves over another series, or out of the plot area. When false, the mouseOut
event on a series is triggered when the mouse leaves the area around the series' graph or
markers. This also implies the tooltip. When stickyTracking is false, the tooltip will be
hidden when moving the mouse between series. Defaults to true.
stickyTracking
- Whether to enable sticky tracking of mouse events.
PlotOptions
instance for convenient method chaining.public T setThreshold(Number threshold)
plotOptions.setOptions("threshold", 0);
The threshold, also called zero level or base level. For line type series this is only used in conjunction with negativeColor. Defaults to 0
threshold
- A minimum z-value determine whether bubbles will be displayed if 'displayNegative' is false.
PlotOptions
instance for convenient method chaining.public T setTurboThreshold(Number turboThreshold)
plotOptions.setOptions("turboThreshold", 1000);
When a series contains a data array that is longer than this, only one dimensional arrays of numbers,
or two dimensional arrays with x and y values are allowed. Also, only the first point is tested, and
the rest are assumed to be the same format. This saves expensive data checking and indexing in long series. Defaults to 1000
turboThreshold
- The maximum size of an array to be greater than two-dimensional and check the format of each entry.
PlotOptions
instance for convenient method chaining.public T setVisible(boolean visible)
plotOptions.setOption("visible", false);
Set the initial visibility of the series. Defaults to true.
visible
- The initial visibility of the series.
PlotOptions
instance for convenient method chaining.public T setZIndex(Number zIndex)
plotOptions.setOption("visible", false);
Define the z index of the series. Defaults to null.
zIndex
- The z index of the series.
PlotOptions
instance for convenient method chaining.public T setZoneAxis(Zone.Axis zoneAxis)
plotOption.setOption("zoneAxis", "y");
Defines the Axis on which the zones are applied. Defaults to y.
zoneAxis
-
PlotOptions
instance for convenient method chaining.Zone.Axis
public T setZones(Zone... zones)
plotOption.setOption("zone", );
zones
- An array defining zones within a series.
PlotOptions
instance for convenient method chaining.Zone
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |