org.moxieapps.gwt.highcharts.client.plotOptions
Class BaseProportionalPlotOptions<T extends BaseProportionalPlotOptions>

java.lang.Object
  extended by org.moxieapps.gwt.highcharts.client.Configurable<T>
      extended by org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions<T>
          extended by org.moxieapps.gwt.highcharts.client.plotOptions.BaseProportionalPlotOptions<T>
Direct Known Subclasses:
FunnelPlotOptions, PiePlotOptions, PyramidPlotOptions

public abstract class BaseProportionalPlotOptions<T extends BaseProportionalPlotOptions>
extends PlotOptions<T>

A common base class for both FunnelPlotOptions and PiePlotOptions to prevent code duplication while still maintaining a cleaner way for the user to utilize the method chaining with the generics in place. You should not use this class directly, but instead use one of the base classes.

Since:
1.6.0
Author:
cskowron@moxiegroup.com (Cory Skowronek)

Nested Class Summary
 
Nested classes/interfaces inherited from class org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions
PlotOptions.Cursor, PlotOptions.PointPlacement, PlotOptions.Stacking
 
Constructor Summary
BaseProportionalPlotOptions()
           
 
Method Summary
 PointLegendItemClickEventHandler getPointLegendItemClickEventHandler()
          Returns the custom event handler that has been set on the plot options, or null if no event handler has been set.
 T setBorderColor(Color borderColor)
          Convenience method for setting the 'borderColor' option of the pie plot options, allowing for colors with opacity or gradients.
 T setBorderColor(String borderColor)
          Convenience method for setting the "borderColor" option for the pie plot options to a RGB hex value.
 T setBorderWidth(Number borderWidth)
          Convenience method for setting the "borderWidth" option for the pie plot options.
 T setCenter(double xPercent, double yPercent)
          Convenience method for setting the 'center' option of the pie plot options to percentage values.
 T setCenter(int x, int y)
          Convenience method for setting the 'center' option of the pie plot options to pixel values.
 T setDepth(Number depth)
          Convenience method for setting the 'depth option of the plot.
 T setIgnoreHiddenPoint(boolean ignoreHiddenPoint)
          Convenience method for setting the "ignoreHiddenPoint" option for the pie plot options.
 T setInnerSize(double innerSize)
          Convenience method for setting the 'innerSize' option of the pie plot options to a percentage value.
 T setInnerSize(int innerSize)
          Convenience method for setting the 'innerSize' option of the pie plot options to pixel values.
 T setMinSize(Number minSize)
          Convenience method for setting the "minSize" option for the pie plot options.
 BaseProportionalPlotOptions setPointLegendItemClickEventHandler(PointLegendItemClickEventHandler pointLegendItemClickEventHandler)
          Set a callback handler that will be invoked whenever the user clicks on the legend item points in a pie or funnel series.
 T setSize(double size)
          Convenience method for setting the 'size' option of the pie plot options to a percentage value.
 T setSize(int size)
          Convenience method for setting the 'size' option of the pie plot options to pixel values.
 T setSlicedOffset(Number slicedOffset)
          Convenience method for setting the "slicedOffset" option for the pie plot options.
 T setStartAngle(Number startAngle)
          Convenience method for setting the "startAngle" option for the pie plot options.
 
Methods inherited from class org.moxieapps.gwt.highcharts.client.plotOptions.PlotOptions
getDataLabels, setAllowPointSelect, setAnimation, setAnimation, setBaseDataLabels, setColor, setColor, setCropThreshold, setCursor, setDashStyle, setDataGrouping, setDataLabels, setEnableMouseTracking, setHoverStateEnabled, setHoverStateLineWidth, setHoverStateMarker, setId, setLegendIndex, setLineWidth, setLinkedTo, setLinkedTo, setMarker, setNegativeColor, setNegativeColor, setPointInterval, setPointPlacement, setPointStart, setSelected, setShadow, setShowCheckbox, setShowInLegend, setStacking, setStickyTracking, setThreshold, setTurboThreshold, setVisible, setZIndex, setZoneAxis, setZones
 
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

BaseProportionalPlotOptions

public BaseProportionalPlotOptions()
Method Detail

setBorderColor

public T setBorderColor(String borderColor)
Convenience method for setting the "borderColor" option for the pie plot options to a RGB hex value. Equivalent to:

     piePlotOptions.setOption("borderColor", "#CCCCCC");
 
The color of the border surrounding each slice. Defaults to #FFFFFF.

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 setBorderColor(Color) version instead.

Parameters:
borderColor - The value to set as the 'borderColor' option of the box plots.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
See Also:
setBorderColor(Color)

setBorderColor

public T setBorderColor(Color borderColor)
Convenience method for setting the 'borderColor' option of the pie plot options, allowing for colors with opacity or gradients. Equivalent to:

     piePlotOptions.setOption("borderColor", new Color()
        .setLinearGradient(0.0, 0.0, 1.0, 1.0)
        .addStop(new Color(255, 255, 255))
        .addStop(new Color(200, 200, 255))
     );
 
The color of the border surrounding each slice. Defaults to #FFFFFF.

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 setBorderColor(String) version instead.

Parameters:
borderColor - The color gradient or color with an alpha channel to set as the 'borderColor' option of the box plot.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
See Also:
setBorderColor(String)

setBorderWidth

public T setBorderWidth(Number borderWidth)
Convenience method for setting the "borderWidth" option for the pie plot options. Equivalent to:

     piePlotOptions.setOptions("borderWidth", 2);
 
The width of the border surrounding each slice. Defaults to 1.

Parameters:
borderWidth - The width of the border
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setCenter

public T setCenter(int x,
                   int y)
Convenience method for setting the 'center' option of the pie plot options to pixel values. Equivalent to:

     piePlotOptions.setOption("center", new Number[] { 100, 120 });
 
The center of the pie chart relative to the plot area (in pixels). See the setCenter(double, double) method to set the center using percentages instead. Defaults to 50%, 50%.

Parameters:
x - The horizontal center of the pie chart relative to the plot area (in pixels)
y - The vertical center of the pie chart relative to the plot area (in pixels)
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setCenter

public T setCenter(double xPercent,
                   double yPercent)
Convenience method for setting the 'center' option of the pie plot options to percentage values. Equivalent to:

     piePlotOptions.setOption("center", new String[] { "50%", "40%" });
 
The center of the pie chart relative to the plot area (as a percentage). See the setCenter(int, int) method to set the center using pixels instead. Defaults to 50%, 50%.

Note that the percentage is specified by providing a floating point number in the range of 0.0 to 1.0, where 0.0 is equivalent to "0%" and 1.0 is equivalent to "100%".

Parameters:
xPercent - The horizontal percent center of the pie chart relative to the plot area (0.0 to 1.0)
yPercent - The vertical percent center of the pie chart relative to the plot area (0.0 to 1.0)
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setDepth

public T setDepth(Number depth)
Convenience method for setting the 'depth option of the plot. Equivalent to:

     piePlotOptions.setOption("depth", 25);
 
The thickness of a 3D pie. Defaults to 0. Note: This option requires highcharts-3d.js

Parameters:
depth - The thickness of a 3D pie.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setIgnoreHiddenPoint

public T setIgnoreHiddenPoint(boolean ignoreHiddenPoint)
Convenience method for setting the "ignoreHiddenPoint" option for the pie plot options. Equivalent to:

     piePlotOptions.setOptions("ignoreHiddenPoint", false);
 
Equivalent to BaseChart.setIgnoreHiddenSeries(boolean), this option tells whether the series shall be redrawn as if the hidden point were null.

The default value changed from false to true with Highcharts 3.0.

Defaults to true.

Parameters:
ignoreHiddenPoint - Whether to redraw the chart if a hidden point is null.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
Since:
1.6.0

setInnerSize

public T setInnerSize(int innerSize)
Convenience method for setting the 'innerSize' option of the pie plot options to pixel values. Equivalent to:

     piePlotOptions.setOption("innerSize", 100);
 
The size of the inner diameter for the pie. A size greater than 0 renders a donut chart. setInnerSize(double) method to set the innerSize using percentages instead. Defaults to 0.

Parameters:
innerSize - The size of the inner diameter for the pie.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setInnerSize

public T setInnerSize(double innerSize)
Convenience method for setting the 'innerSize' option of the pie plot options to a percentage value. Equivalent to:

     piePlotOptions.setOption("innerSize", "50%");
 
The size of the inner diameter for the pie. A size greater than 0 renders a donut chart. See the setInnerSize(int) method to set the innerSize using pixels instead. Defaults to 0.

Note that the percentage is specified by providing a floating point number in the range of 0.0 to 1.0, where 0.0 is equivalent to "0%" and 1.0 is equivalent to "100%".

Parameters:
innerSize - The percentage size of the inner diameter for the pie. (0.0 to 1.0)
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setMinSize

public T setMinSize(Number minSize)
Convenience method for setting the "minSize" option for the pie plot options. Equivalent to:

     piePlotOptions.setOptions("minSize", true);
 
The minimum size for a pie in response to auto margins. The pie will try to shrink to make room for data labels in side the plot area, but only to this size. Defaults to 80.

Parameters:
minSize - The minimum size for a pie in response to auto margins
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
Since:
1.6.0

setSize

public T setSize(int size)
Convenience method for setting the 'size' option of the pie plot options to pixel values. Equivalent to:

     piePlotOptions.setOption("size", 100);
 
The diameter of the pie relative to the plot area (in pixels). See the setSize(double) method to set the size using percentages instead. Defaults to 75%.

Parameters:
size - The diameter of the pie relative to the plot area.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setSize

public T setSize(double size)
Convenience method for setting the 'size' option of the pie plot options to a percentage value. Equivalent to:

     piePlotOptions.setOption("size", "50%");
 
The diameter of the pie relative to the plot area (as a percentage). See the setSize(int) method to set the size using pixels instead. Defaults to 75%.

Note that the percentage is specified by providing a floating point number in the range of 0.0 to 1.0, where 0.0 is equivalent to "0%" and 1.0 is equivalent to "100%".

Parameters:
size - The percent diameter of the pie relative to the plot area. (0.0 to 1.0)
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.

setSlicedOffset

public T setSlicedOffset(Number slicedOffset)
Convenience method for setting the "slicedOffset" option for the pie plot options. Equivalent to:

     piePlotOptions.setOptions("slicedOffset", 25);
 
If a point is sliced, moved out from the center, how many pixels should it be moved?. Defaults to 10.

Parameters:
slicedOffset - The number of pixels the point should be moved if it is sliced.
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
Since:
1.6.0

setStartAngle

public T setStartAngle(Number startAngle)
Convenience method for setting the "startAngle" option for the pie plot options. Equivalent to:

     piePlotOptions.setOptions("startAngle", 45);
 
The start angle of the pie slices in degrees where 0 is top and 90 right. Defaults to 0.

Parameters:
startAngle - The start angle of the pie slices in degrees where 0 is top and 90 right
Returns:
A reference to this BaseProportionalPlotOptions instance for convenient method chaining.
Since:
1.6.0

setPointLegendItemClickEventHandler

public BaseProportionalPlotOptions setPointLegendItemClickEventHandler(PointLegendItemClickEventHandler pointLegendItemClickEventHandler)
Set a callback handler that will be invoked whenever the user clicks on the legend item points in a pie or funnel series. Additional information about the click (such as the values of the point clicked) can be found via the PointLegendItemClickEventHandler instance that is passed to the handler's PointLegendItemClickEventHandler.onClick(org.moxieapps.gwt.highcharts.client.events.PointLegendItemClickEvent) method.

Parameters:
pointLegendItemClickEventHandler - The handler that should be invoked whenever a legend item click event occurs.
Returns:
A reference to this BaseChart instance for convenient method chaining.

getPointLegendItemClickEventHandler

public PointLegendItemClickEventHandler getPointLegendItemClickEventHandler()
Returns the custom event handler that has been set on the plot options, or null if no event handler has been set.

Returns:
The custom event handler that has been applied, or null if it has not been set.


Copyright © 2015. All Rights Reserved.