Class Chart
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Chart
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class Chart extends Optionable
An Chart options regarding the chart area and plot area as well as general chart options.All the options in this class support
DynamicalAttribute.- Author:
- jumperchen, RaymondChao
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Chart()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEvent(String name, org.zkoss.json.JavaScriptValue event)Sets a client side event for the chart.AnimationgetAnimation()Returns the overall animation for all chart updating.intgetAxisLayoutRuns()Returns the number of axis layout runs.ColorgetBackgroundColor()Returns the background color or gradient for the outer chart area.ColorgetBorderColor()Returns the color of the outer chart border.ObjectgetBorderRadius()Returns the corner radius of the outer chart border.NumbergetBorderWidth()Returns the pixel width of the outer chart border.StringgetClassName()Returns a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.Map<String,org.zkoss.json.JavaScriptValue>getEventsMap()Returns a map of client side event listeners for the chart.NumbergetHeight()Returns an explicit height for the chart.Number[]getMargin()Returns the margin between the outer edge of the chart and the plot area.NumbergetMarginBottom()Returns the margin between the bottom outer edge of the chart and the plot area.NumbergetMarginLeft()Returns the margin between the left outer edge of the chart and the plot area.NumbergetMarginRight()Returns the margin between the right outer edge of the chart and the plot area.NumbergetMarginTop()Returns the margin between the top outer edge of the chart and the plot area.Options3DgetOptions3D()Returns the options to render charts in 3 dimensions.StringgetPanKey()Returns setting a key to switch between zooming and panning.ParallelAxesgetParallelAxes()Returns common options for all yAxes rendered in a parallel coordinates plot, if any.StringgetPinchType()Returns equivalent togetZoomType(), but for multitouch gestures only.ColorgetPlotBackgroundColor()Returns the background color for the plot area.StringgetPlotBackgroundImage()Returns the URL for an image to use as the plot background.ColorgetPlotBorderColor()Returns the color of the inner chart or plot area border.NumbergetPlotBorderWidth()Returns the pixel width of the plot area border.ObjectgetPlotShadow()Returns the PlotShadow object or boolean value of plot shadow, depend on what was set.ResetZoomButtongetResetZoomButton()Returns the button that appears after a selection zoom, allowing the user to reset zoom.ScrollablePlotAreagetScrollablePlotArea()Returns the options for a scrollable plot area.ColorgetSelectionMarkerFill()Returns the background color of the marker square when selecting (zooming in on) an area of the chart.ShadowgetSeriesGroupShadow()Returns the shadow configuration applied to the global series group.ShadowgetShadow()Returns whether to apply a drop shadow to the outer chart area.Number[]getSpacing()Returns the distance between the outer edge of the chart and the content, like title, legend, axis title or labels.NumbergetSpacingBottom()Returns the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).NumbergetSpacingLeft()Returns the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).NumbergetSpacingRight()Returns the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).NumbergetSpacingTop()Returns the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).<K,V>
Map<K,V>getStyle()Returns additional CSS styles to apply inline to the containerdiv.StringgetType()Returns the default series type for the chart.NumbergetWidth()Returns an explicit width for the chart.StringgetZoomType()Returns decides in what dimensions the user can zoom by dragging the mouse.booleanisAlignTicks()Returns when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.booleanisAnimation()Returns whether enable the animationBooleanisEnableZoomSelection()Returns whether selection event will zoom the chart to the selected area.booleanisIgnoreHiddenSeries()Returns if true, the axes will scale to the remaining visible series once one series is hidden.booleanisInverted()Returns whether to invert the axes so that the x axis is vertical and y axis is horizontal.booleanisPanning()Returns if allow panning in a chart.booleanisParallelCoordinates()Returns a flag to render charts as a parallel coordinates plot.booleanisPlotShadow()Returns whether to apply a drop shadow to the plot area.booleanisPolar()Returns whether transforms into the polar coordinate systembooleanisReflow()Returns whether to reflow the chart to fit the width of the container div on resizing the window.booleanisSeriesGroupShadow()Returns whether a drop shadow is applied to the global series group.booleanisShadow()Returns whether to apply a drop shadow to the outer chart area.booleanisShowAxes()Returns whether to show the axes initially.booleanisStyledMode()Returns whether to apply styled mode.voidsetAlignTicks(boolean alignTicks)Sets when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks.voidsetAnimation(boolean animation)Animation can be disabled throughout the chart by setting it to false here.voidsetAnimation(Animation animation)Animation can be disabled throughout the chart by setting it to false by the method ofsetAnimation(boolean).voidsetAxisLayoutRuns(int axisLayoutRuns)When a chart with an x and a y-axis is rendered, we first pre-render the labels of both in order to measure them.voidsetBackgroundColor(String color)Sets the background color or gradient for the outer chart area.voidsetBackgroundColor(Color color)Sets the background color or gradient for the outer chart area.voidsetBackgroundColor(LinearGradient color)Sets the background color or gradient for the outer chart area.voidsetBackgroundColor(RadialGradient color)Sets the background color or gradient for the outer chart area.voidsetBorderColor(String color)Sets the color of the outer chart border.voidsetBorderColor(Color color)Sets the color of the outer chart border.voidsetBorderColor(LinearGradient color)Sets the color of the outer chart border.voidsetBorderColor(RadialGradient color)Sets the color of the outer chart border.voidsetBorderRadius(Number borderRadius)Sets the corner radius of the outer chart border.voidsetBorderRadius(String borderRadius)Sets the corner radius of the outer chart border.voidsetBorderWidth(Number borderWidth)Sets the pixel width of the outer chart border.voidsetClassName(String className)Sets a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.voidsetEnableZoomSelection(boolean enableZoomSelection)Sets whether selection event will zoom the chart to the selected area.voidsetEvents(Map<String,org.zkoss.json.JavaScriptValue> events)Sets a map of client side event listeners for the chart.voidsetHeight(Number height)Sets an explicit height for the chart.voidsetHeight(String height)Sets an explicit height for the chart.voidsetIgnoreHiddenSeries(boolean ignoreHiddenSeries)Sets to ignore the hidden series, if true, the axes will scale to the remaining visible series once one series is hidden.voidsetInverted(boolean inverted)Sets whether to invert the axes so that the x axis is vertical and y axis is horizontal.voidsetMargin(Number margin)Sets the margin between the outer edge of the chart and the plot area.voidsetMargin(Number[] margin)Sets the margin between the outer edge of the chart and the plot area.voidsetMarginBottom(Number marginBottom)Sets the margin between the bottom outer edge of the chart and the plot area.voidsetMarginLeft(Number marginLeft)Sets the margin between the left outer edge of the chart and the plot area.voidsetMarginRight(Number marginRight)Sets the margin between the right outer edge of the chart and the plot area.voidsetMarginTop(Number marginTop)Sets the margin between the top outer edge of the chart and the plot area.voidsetOptions3D(Options3D options3D)Sets the options to render charts in 3 dimensions.voidsetPanKey(String panKey)Sets setting a key to switch between zooming and panning.voidsetPanning(boolean panning)Sets if allow panning in a chart.voidsetParallelAxes(ParallelAxes parallelAxes)Sets common options for all yAxes rendered in a parallel coordinates plot.voidsetParallelCoordinates(boolean parallelCoordinates)Sets a flag to render charts as a parallel coordinates plot.voidsetPinchType(String pinchType)Sets equivalent tosetZoomType(String), but for multitouch gestures only.voidsetPlotBackgroundColor(String color)Sets the background color for the plot area.voidsetPlotBackgroundColor(Color color)Sets the background color for the plot area.voidsetPlotBackgroundColor(LinearGradient color)Sets the background color for the plot area.voidsetPlotBackgroundColor(RadialGradient color)Sets the background color for the plot area.voidsetPlotBackgroundImage(String plotBackgroundImage)Sets the URL for an image to use as the plot background.voidsetPlotBorderColor(String color)Sets the color of the inner chart or plot area border.voidsetPlotBorderColor(Color color)Sets the color of the inner chart or plot area border.voidsetPlotBorderColor(LinearGradient color)Sets the color of the inner chart or plot area border.voidsetPlotBorderColor(RadialGradient color)Sets the color of the inner chart or plot area border.voidsetPlotBorderWidth(Number plotBorderWidth)Sets the pixel width of the plot area border.voidsetPlotShadow(boolean plotShadow)Sets whether to apply a drop shadow to the plot area.voidsetPlotShadow(PlotShadow plotShadow)Sets whether to apply a drop shadow to the plot area.voidsetPolar(boolean polar)Sets to true to enable the cartesian charts like line, spline, area and column are transformed into the polar coordinate system.voidsetReflow(boolean reflow)Sets whether to reflow the chart to fit the width of the container div on resizing the window.voidsetResetZoomButton(ResetZoomButton resetZoomButton)Sets the button that appears after a selection zoom, allowing the user to reset zoom.voidsetScrollablePlotArea(ScrollablePlotArea scrollablePlotArea)Sets the options for a scrollable plot area.voidsetSelectionMarkerFill(String color)Sets the background color of the marker square when selecting (zooming in on) an area of the chart.voidsetSelectionMarkerFill(Color color)Sets the background color of the marker square when selecting (zooming in on) an area of the chart.voidsetSelectionMarkerFill(LinearGradient color)Sets the background color of the marker square when selecting (zooming in on) an area of the chart.voidsetSelectionMarkerFill(RadialGradient color)Sets the background color of the marker square when selecting (zooming in on) an area of the chart.voidsetSeriesGroupShadow(boolean seriesGroupShadow)Sets whether to apply a drop shadow to the global series group.voidsetSeriesGroupShadow(Shadow seriesGroupShadow)Sets the shadow configuration for the global series group.voidsetShadow(boolean shadow)Sets whether to apply a drop shadow to the outer chart area.voidsetShadow(Shadow shadow)Sets whether to apply a drop shadow to the outer chart area.voidsetShowAxes(boolean showAxes)Sets whether to show the axes initially.voidsetSpacing(Number[] spacing)Sets the distance between the outer edge of the chart and the content, like title, legend, axis title or labels.voidsetSpacingBottom(Number spacingBottom)Sets the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).voidsetSpacingLeft(Number spacingLeft)Sets the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).voidsetSpacingRight(Number spacingRight)Sets the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).voidsetSpacingTop(Number spacingTop)Sets the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).voidsetStyle(String style)Sets additional CSS styles to apply inline to the containerdiv.<K,V>
voidsetStyle(Map<K,V> style)Sets additional CSS styles to apply inline to the containerdiv.voidsetStyledMode(boolean styledMode)Sets whether to apply styled mode.voidsetType(String type)Sets the default series type for the chart.voidsetWidth(Number width)Sets an explicit width for the chart.voidsetWidth(String width)Sets an explicit width for the chart.voidsetZoomType(String zoomType)Sets decides in what dimensions the user can zoom by dragging the mouse.-
Methods inherited from class org.zkoss.chart.Optionable
addExtraAttr, addOptionDataListener, clearOptonDataListener, clone, containsKey, fireEvent, fireEvent, fireEvent, fireEvent, fireEvent, getAttr, getAttr, getClientState, getExtraAttr, merge, onChange, removeExtraAttr, removeKey, removeOptionDataListener, setAttr, setAttr, setAttr, setAttr, toJSONString, toString
-
-
-
-
Method Detail
-
isAlignTicks
public boolean isAlignTicks()
Returns when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by settingalignTicksto false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by settinggridLineWidthto 0.Default: true.
-
setAlignTicks
public void setAlignTicks(boolean alignTicks)
Sets when using multiple axis, the ticks of two or more opposite axes will automatically be aligned by adding ticks to the axis or axes with the least ticks. This can be prevented by settingalignTicksto false. If the grid lines look messy, it's a good idea to hide them for the secondary axis by settinggridLineWidthto 0.
-
getAnimation
public Animation getAnimation()
Returns the overall animation for all chart updating.Default: an instance of
Animation
-
isAnimation
public boolean isAnimation()
Returns whether enable the animationDefault: true
-
setAnimation
public void setAnimation(boolean animation)
Animation can be disabled throughout the chart by setting it to false here. It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, seeSeriesPlotOptions.setAnimation(boolean).The animation can either be set as a boolean or a configuration object. See
setAnimation(Animation). Iftrue, it will use the 'swing' jQuery easing and a duration of 500 ms. If used as an Animation object, the following properties are supported:- duration
- The duration of the animation in milliseconds.
- easing
- When using jQuery as the general framework, the easing can be set to
linearorswing. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooTools as the general framework, use the property nametransitioninstead ofeasing.
- See Also:
setAnimation(Animation),Animation
-
setAnimation
public void setAnimation(Animation animation)
Animation can be disabled throughout the chart by setting it to false by the method ofsetAnimation(boolean). It can be overridden for each individual API method as a function parameter. The only animation not affected by this option is the initial series animation, seeSeriesPlotOptions.setAnimation(boolean).Properties are supported:
- duration
- The duration of the animation in milliseconds.
- easing
- When using jQuery as the general framework, the easing can be set to
linearorswing. More easing functions are available with the use of jQuery plug-ins, most notably the jQuery UI suite. See the jQuery docs. When using MooTools as the general framework, use the property nametransitioninstead ofeasing.
- See Also:
setAnimation(boolean),Animation
-
setAxisLayoutRuns
public void setAxisLayoutRuns(int axisLayoutRuns)
When a chart with an x and a y-axis is rendered, we first pre-render the labels of both in order to measure them. Then, if either of the axis labels take up so much space that it significantly affects the length of the other axis, we repeat the process.
By default, we stop at two axis layout runs, but it may be that the second run also alter the space required by either axis, for example if it causes the labels to rotate. In this situation, a subsequent redraw of the chart may cause the tick and label placement to change for apparently no reason. Use the axisLayoutRuns option to set the maximum allowed number of repetitions. But keep in mind that the default value of 2 is set because every run costs performance time.
Note: Changing that option to higher than the default might decrease performance significantly, especially with bigger sets of data.
Default: 2
- Parameters:
axisLayoutRuns- the number of axis layout runs- Since:
- 11.3.0.0
-
getAxisLayoutRuns
public int getAxisLayoutRuns()
Returns the number of axis layout runs.Default: 2
-
getBackgroundColor
public Color getBackgroundColor()
Returns the background color or gradient for the outer chart area.Default: "#FFFFFF".
-
setBackgroundColor
public void setBackgroundColor(Color color)
Sets the background color or gradient for the outer chart area.
-
setBackgroundColor
public void setBackgroundColor(String color)
Sets the background color or gradient for the outer chart area.
-
setBackgroundColor
public void setBackgroundColor(LinearGradient color)
Sets the background color or gradient for the outer chart area.
-
setBackgroundColor
public void setBackgroundColor(RadialGradient color)
Sets the background color or gradient for the outer chart area.
-
getBorderColor
public Color getBorderColor()
Returns the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.Default: "#4572A7".
-
setBorderColor
public void setBorderColor(Color color)
Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
-
setBorderColor
public void setBorderColor(String color)
Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
-
setBorderColor
public void setBorderColor(LinearGradient color)
Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
-
setBorderColor
public void setBorderColor(RadialGradient color)
Sets the color of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.
-
getBorderRadius
public Object getBorderRadius()
Returns the corner radius of the outer chart border. In export, the radius defaults to 0.Default: 5.
-
setBorderRadius
public void setBorderRadius(Number borderRadius)
Sets the corner radius of the outer chart border. In export, the radius defaults to 0.Default: 5.
- Parameters:
borderRadius- the corner radius of the outer chart border
-
setBorderRadius
public void setBorderRadius(String borderRadius)
Sets the corner radius of the outer chart border. In export, the radius defaults to 0.Default: 5.
- Parameters:
borderRadius- the corner radius of the outer chart border
-
getBorderWidth
public Number getBorderWidth()
Returns the pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.Default: 0.
-
setBorderWidth
public void setBorderWidth(Number borderWidth)
Sets the pixel width of the outer chart border. The border is painted using vector graphic techniques to allow rounded corners.- Parameters:
borderWidth- the pixel width of the outer chart border
-
getClassName
public String getClassName()
Returns a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.- Since:
- 7.2.1.0
-
setClassName
public void setClassName(String className)
Sets a CSS class name to apply to the charts container div, allowing unique CSS styling for each chart.- Since:
- 7.2.1.0
-
getEventsMap
public Map<String,org.zkoss.json.JavaScriptValue> getEventsMap()
Returns a map of client side event listeners for the chart.- Since:
- 7.2.2.0
-
setEvents
public void setEvents(Map<String,org.zkoss.json.JavaScriptValue> events)
Sets a map of client side event listeners for the chart.- Since:
- 7.2.2.0
-
addEvent
public void addEvent(String name, org.zkoss.json.JavaScriptValue event)
Sets a client side event for the chart.- Since:
- 7.2.2.0
-
getHeight
public Number getHeight()
Returns an explicit height for the chart. By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0.Default: null.
-
setHeight
public void setHeight(Number height)
Sets an explicit height for the chart. By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0.
-
setHeight
public void setHeight(String height)
Sets an explicit height for the chart. If given a percentage string (for example '56%'), the height is given as the percentage of the actual chart width. This allows for preserving the aspect ratio across responsive sizes.- Since:
- 7.2.1.0
-
isIgnoreHiddenSeries
public boolean isIgnoreHiddenSeries()
Returns if true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected.Default: true.
-
setIgnoreHiddenSeries
public void setIgnoreHiddenSeries(boolean ignoreHiddenSeries)
Sets to ignore the hidden series, if true, the axes will scale to the remaining visible series once one series is hidden. If false, hiding and showing a series will not affect the axes or the other series. For stacks, once one series within the stack is hidden, the rest of the stack will close in around it even if the axis is not affected.- Parameters:
ignoreHiddenSeries- if true, the axes will scale to the remaining visible series once one series is hidden
-
isInverted
public boolean isInverted()
Returns whether to invert the axes so that the x axis is vertical and y axis is horizontal. When true, the x axis is reversed by default. If a bar series is present in the chart, it will be inverted automatically.Default: false.
-
setInverted
public void setInverted(boolean inverted)
Sets whether to invert the axes so that the x axis is vertical and y axis is horizontal. When true, the x axis is reversed by default. If a bar series is present in the chart, it will be inverted automatically.- Parameters:
inverted- whether to invert the axes so that the x axis is vertical and y axis is horizontal
-
getMargin
public Number[] getMargin()
Returns the margin between the outer edge of the chart and the plot area. The numbers in the array designate top, right, bottom and left respectively. Use the methods ofsetMarginTop(Number),setMarginRight(Number),setMarginBottom(Number)andsetMarginLeft(Number)for shorthand setting of one option.Default: null.
-
setMargin
public void setMargin(Number[] margin)
Sets the margin between the outer edge of the chart and the plot area. The numbers in the array designate top, right, bottom and left respectively. Use the methods ofsetMarginTop(Number),setMarginRight(Number),setMarginBottom(Number)andsetMarginLeft(Number)for shorthand setting of one option.Default: null.
-
setMargin
public void setMargin(Number margin)
Sets the margin between the outer edge of the chart and the plot area.
-
getMarginBottom
public Number getMarginBottom()
Returns the margin between the bottom outer edge of the chart and the plot area.Default: null.
-
setMarginBottom
public void setMarginBottom(Number marginBottom)
Sets the margin between the bottom outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See alsosetSpacingBottom(Number).- Parameters:
marginBottom- the margin between the bottom outer edge of the chart and the plot area
-
getMarginLeft
public Number getMarginLeft()
Returns the margin between the left outer edge of the chart and the plot area.Default: null.
-
setMarginLeft
public void setMarginLeft(Number marginLeft)
Sets the margin between the left outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See alsosetSpacingLeft(Number)- Parameters:
marginLeft- the margin between the left outer edge of the chart and the plot area
-
getMarginRight
public Number getMarginRight()
Returns the margin between the right outer edge of the chart and the plot area.Default: null
-
setMarginRight
public void setMarginRight(Number marginRight)
Sets the margin between the right outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See alsosetSpacingRight(Number).- Parameters:
marginRight- the margin between the right outer edge of the chart and the plot area
-
getMarginTop
public Number getMarginTop()
Returns the margin between the top outer edge of the chart and the plot area.Default: null.
-
setMarginTop
public void setMarginTop(Number marginTop)
Sets the margin between the top outer edge of the chart and the plot area. Use this to set a fixed pixel value for the margin as opposed to the default dynamic margin. See alsosetSpacingTop(Number).- Parameters:
marginTop- the margin between the top outer edge of the chart and the plot area
-
getOptions3D
public Options3D getOptions3D()
Returns the options to render charts in 3 dimensions.Default: null.
-
setOptions3D
public void setOptions3D(Options3D options3D)
Sets the options to render charts in 3 dimensions.- Parameters:
options3D- the options to render charts in 3 dimensions.
-
getPanKey
public String getPanKey()
Returns setting a key to switch between zooming and panning. Can be one of alt, ctrl, meta (the command key on Mac and Windows key on Windows) or shift. The keys are mapped directly to the key properties of the click event argument (event.altKey, event.ctrlKey, event.metaKey and event.shiftKey).Default: null
- Since:
- 7.2.1.0
-
setPanKey
public void setPanKey(String panKey)
Sets setting a key to switch between zooming and panning. Can be one of alt, ctrl, meta (the command key on Mac and Windows key on Windows) or shift. The keys are mapped directly to the key properties of the click event argument (event.altKey, event.ctrlKey, event.metaKey and event.shiftKey).- Since:
- 7.2.1.0
-
isPanning
public boolean isPanning()
Returns if allow panning in a chart. Best used with panKey to combine zooming and panning. On touch devices, when the tooltip.followTouchMove option is true (default), panning requires two fingers. To allow panning with one finger, set followTouchMove to false.Default: false
- Since:
- 7.2.1.0
-
setPanning
public void setPanning(boolean panning)
Sets if allow panning in a chart. Best used with panKey to combine zooming and panning. On touch devices, when the tooltip.followTouchMove option is true (default), panning requires two fingers. To allow panning with one finger, set followTouchMove to false.- Since:
- 7.2.1.0
-
getParallelAxes
public ParallelAxes getParallelAxes()
Returns common options for all yAxes rendered in a parallel coordinates plot, if any. Otherwise, create a new one.- Since:
- 7.2.1.0
-
setParallelAxes
public void setParallelAxes(ParallelAxes parallelAxes)
Sets common options for all yAxes rendered in a parallel coordinates plot.- Since:
- 7.2.1.0
-
isParallelCoordinates
public boolean isParallelCoordinates()
Returns a flag to render charts as a parallel coordinates plot. In a parallel coordinates plot (||-coords) by default all required yAxes are generated and the legend is disabled.Default: false
- Since:
- 7.2.1.0
-
setParallelCoordinates
public void setParallelCoordinates(boolean parallelCoordinates)
Sets a flag to render charts as a parallel coordinates plot. In a parallel coordinates plot (||-coords) by default all required yAxes are generated and the legend is disabled.- Since:
- 7.2.1.0
-
getPinchType
public String getPinchType()
Returns equivalent togetZoomType(), but for multitouch gestures only. By default, thepinchTypeis the same as thezoomTypesetting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse drag pans the chart, while pinching is enabled.Default: null.
-
setPinchType
public void setPinchType(String pinchType)
Sets equivalent tosetZoomType(String), but for multitouch gestures only. By default, thepinchTypeis the same as thezoomTypesetting. However, pinching can be enabled separately in some cases, for example in stock charts where a mouse drag pans the chart, while pinching is enabled.Default: null.
- See Also:
setZoomType(String)
-
getPlotBackgroundColor
public Color getPlotBackgroundColor()
Returns the background color for the plot area.Default: null.
-
setPlotBackgroundColor
public void setPlotBackgroundColor(Color color)
Sets the background color for the plot area.
-
setPlotBackgroundColor
public void setPlotBackgroundColor(String color)
Sets the background color for the plot area.
-
setPlotBackgroundColor
public void setPlotBackgroundColor(LinearGradient color)
Sets the background color for the plot area.
-
setPlotBackgroundColor
public void setPlotBackgroundColor(RadialGradient color)
Sets the background color for the plot area.
-
getPlotBackgroundImage
public String getPlotBackgroundImage()
Returns the URL for an image to use as the plot background.Default: null.
-
setPlotBackgroundImage
public void setPlotBackgroundImage(String plotBackgroundImage)
Sets the URL for an image to use as the plot background. To set an image as the background for the entire chart, set a CSS background image to the container element. Note that for the image to be applied to exported charts, its URL needs to be accessible by the export server.- Parameters:
plotBackgroundImage- the URL for an image to use as the plot background
-
getPlotBorderColor
public Color getPlotBorderColor()
Returns the color of the inner chart or plot area border.Default: "#C0C0C0".
-
setPlotBorderColor
public void setPlotBorderColor(Color color)
Sets the color of the inner chart or plot area border.
-
setPlotBorderColor
public void setPlotBorderColor(String color)
Sets the color of the inner chart or plot area border.
-
setPlotBorderColor
public void setPlotBorderColor(LinearGradient color)
Sets the color of the inner chart or plot area border.
-
setPlotBorderColor
public void setPlotBorderColor(RadialGradient color)
Sets the color of the inner chart or plot area border.
-
getPlotBorderWidth
public Number getPlotBorderWidth()
Returns the pixel width of the plot area border.Default: 0.
-
setPlotBorderWidth
public void setPlotBorderWidth(Number plotBorderWidth)
Sets the pixel width of the plot area border.- Parameters:
plotBorderWidth- the pixel width of the plot area border
-
getPlotShadow
public Object getPlotShadow()
Returns the PlotShadow object or boolean value of plot shadow, depend on what was set. To apply a drop shadow to the plot area.- Since:
- 11.2.0.0
-
isPlotShadow
public boolean isPlotShadow()
Returns whether to apply a drop shadow to the plot area. Requires thatsetPlotBackgroundColor(String)be set.Default: false.
-
setPlotShadow
public void setPlotShadow(boolean plotShadow)
Sets whether to apply a drop shadow to the plot area. Requires thatsetPlotBackgroundColor(String)be set.- Parameters:
plotShadow- whether to apply a drop shadow to the plot area
-
setPlotShadow
public void setPlotShadow(PlotShadow plotShadow)
Sets whether to apply a drop shadow to the plot area. Requires thatsetPlotBackgroundColor(String)be set.- Parameters:
plotShadow- whether to apply a drop shadow to the plot area- Since:
- 11.2.0.0
-
isPolar
public boolean isPolar()
Returns whether transforms into the polar coordinate systemDefault: false.
-
setPolar
public void setPolar(boolean polar)
Sets to true to enable the cartesian charts like line, spline, area and column are transformed into the polar coordinate system.- Parameters:
polar- when true, cartesian charts like line, spline, area and column are transformed into the polar coordinate system
-
isReflow
public boolean isReflow()
Returns whether to reflow the chart to fit the width of the container div on resizing the window.Default: true.
-
setReflow
public void setReflow(boolean reflow)
Sets whether to reflow the chart to fit the width of the container div on resizing the window.- Parameters:
reflow- whether to reflow the chart to fit the width of the container div on resizing the window
-
getResetZoomButton
public ResetZoomButton getResetZoomButton()
Returns the button that appears after a selection zoom, allowing the user to reset zoom.Default: null.
-
setResetZoomButton
public void setResetZoomButton(ResetZoomButton resetZoomButton)
Sets the button that appears after a selection zoom, allowing the user to reset zoom.- Parameters:
resetZoomButton- the button that appears after a selection zoom, allowing the user to reset zoom
-
getScrollablePlotArea
public ScrollablePlotArea getScrollablePlotArea()
Returns the options for a scrollable plot area.- Since:
- 7.2.2.0
-
setScrollablePlotArea
public void setScrollablePlotArea(ScrollablePlotArea scrollablePlotArea)
Sets the options for a scrollable plot area.- Since:
- 7.2.2.0
-
getSelectionMarkerFill
public Color getSelectionMarkerFill()
Returns the background color of the marker square when selecting (zooming in on) an area of the chart.Default: "rgba(69,114,167,0.25)".
-
setSelectionMarkerFill
public void setSelectionMarkerFill(Color color)
Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
-
setSelectionMarkerFill
public void setSelectionMarkerFill(String color)
Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
-
setSelectionMarkerFill
public void setSelectionMarkerFill(LinearGradient color)
Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
-
setSelectionMarkerFill
public void setSelectionMarkerFill(RadialGradient color)
Sets the background color of the marker square when selecting (zooming in on) an area of the chart.
-
isSeriesGroupShadow
public boolean isSeriesGroupShadow()
Returns whether a drop shadow is applied to the global series group. When true, a single shadow is rendered for the entire series group rather than individual shadows per series, preventing shadow overlap in stacked or adjacent series.Default: false.
- Since:
- 12.5.0.0
-
getSeriesGroupShadow
public Shadow getSeriesGroupShadow()
Returns the shadow configuration applied to the global series group.Default:
Shadow.NONE.- Since:
- 12.5.0.0
- See Also:
Shadow
-
setSeriesGroupShadow
public void setSeriesGroupShadow(boolean seriesGroupShadow)
Sets whether to apply a drop shadow to the global series group.- Since:
- 12.5.0.0
-
setSeriesGroupShadow
public void setSeriesGroupShadow(Shadow seriesGroupShadow)
Sets the shadow configuration for the global series group.- Since:
- 12.5.0.0
- See Also:
Shadow
-
isShadow
public boolean isShadow()
Returns whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.Default: false.
- See Also:
Shadow
-
getShadow
public Shadow getShadow()
Returns whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.Default:
Shadow.NONE.- See Also:
Shadow
-
setShadow
public void setShadow(boolean shadow)
Sets whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.
-
setShadow
public void setShadow(Shadow shadow)
Sets whether to apply a drop shadow to the outer chart area. Requires that backgroundColor be set.- See Also:
Shadow
-
isShowAxes
public boolean isShowAxes()
Returns whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes are automatically added to cartesian series.Default: false.
-
setShowAxes
public void setShowAxes(boolean showAxes)
Sets whether to show the axes initially. This only applies to empty charts where series are added dynamically, as axes are automatically added to cartesian series.- Parameters:
showAxes- whether to show the axes initially
-
getSpacing
public Number[] getSpacing()
Returns the distance between the outer edge of the chart and the content, like title, legend, axis title or labels. The numbers in the array designate top, right, bottom and left respectively.Default: [10, 10, 15, 10].
-
setSpacing
public void setSpacing(Number[] spacing)
Sets the distance between the outer edge of the chart and the content, like title, legend, axis title or labels. The numbers in the array designate top, right, bottom and left respectively. Use the methods ofsetSpacingTop(Number),setSpacingRight(Number),setSpacingBottom(Number)andsetSpacingLeft(Number)for shorthand setting of one option.- Parameters:
spacing- the distance between the outer edge of the chart and the content, like title, legend, axis title or labels
-
getSpacingBottom
public Number getSpacingBottom()
Returns the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).Default: 15.
-
setSpacingBottom
public void setSpacingBottom(Number spacingBottom)
Sets the space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).- Parameters:
spacingBottom- The space between the bottom edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
-
getSpacingLeft
public Number getSpacingLeft()
Returns the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).Default: 10.
-
setSpacingLeft
public void setSpacingLeft(Number spacingLeft)
Sets the space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).- Parameters:
spacingLeft- The space between the left edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
-
getSpacingRight
public Number getSpacingRight()
Returns the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).Default: 10.
-
setSpacingRight
public void setSpacingRight(Number spacingRight)
Sets the space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).- Parameters:
spacingRight- The space between the right edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
-
getSpacingTop
public Number getSpacingTop()
Returns the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).Default: 10.
-
setSpacingTop
public void setSpacingTop(Number spacingTop)
Sets the space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position).- Parameters:
spacingTop- The space between the top edge of the chart and the content (plot area, axis title and labels, title, subtitle or legend in top position)
-
getStyle
public <K,V> Map<K,V> getStyle()
Returns additional CSS styles to apply inline to the containerdiv. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally. Defaults to:fontFamily: "Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif; fontSize: 12px
- Type Parameters:
K- type for the keyif style was set using
setStyle(String), type will be Stringif style was set using
setStyle(Map), type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
V- type for the valueif style was set using
setStyle(String), type will be Stringif style was set using
setStyle(Map), type will be the same as the type from the key of the mapif style was not set, default style will be applied, and type will be String
-
isStyledMode
public boolean isStyledMode()
Returns whether to apply styled mode. When in styled mode, no presentational attributes or CSS are applied to the chart SVG. Instead, CSS rules are required to style the chart. The default style sheet is available from highcharts.css.Default:
false- Since:
- 10.2.1.0
-
setStyledMode
public void setStyledMode(boolean styledMode)
Sets whether to apply styled mode. When in styled mode, no presentational attributes or CSS are applied to the chart SVG. Instead, CSS rules are required to style the chart. The default style sheet is available from highcharts.css.Default:
false- Since:
- 10.2.1.0
-
setStyle
public void setStyle(String style)
Sets additional CSS styles to apply inline to the containerdiv. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally.This method allows simple settings like
label.setStyle("fontWeight: 'bold'; color: 'white'; textShadow: '0px 1px 2px black'");In the format of CSS key:value, and ";" separating multiple key:value pairs, if you have more a complex CSS styling, we recommend using
setStyle(Map)- Parameters:
style- one or many CSS key:value pairs in a single line string format- See Also:
setStyle(Map)
-
setStyle
public <K,V> void setStyle(Map<K,V> style)
Sets additional CSS styles to apply inline to the containerdiv. Note that since the default font styles are applied in the renderer, it is ignorant of the individual chart options and must be set globally.This method allows complex styling like:
which will generate the final results like:Map<String, Object> styles = new HashMap<String, Object>(); styles.put("fill", "#E8E8EA"); styles.put("stroke", "#6E6E78"); styles.put("stroke-width", "1"); styles.put("r", "0"); Map<String, Object> states = new HashMap<String, Object>(); Map<String, String> hover = new HashMap<String, String>(); hover.put("fill", "#F4F4F6"); hover.put("stroke", "#6E6E78"); hover.put("stroke-width", "1"); hover.put("r", "0"); states.put("hover", hover); styles.put("states", states); Map<String, String> style = new HashMap<String, String>(); style.put("color", "#4D5663"); style.put("fontSize", "12px"); style.put("fontFamily", "'Arial'"); style.put("fontWeight", "normal"); style.put("padding", "10px"); styles.put("style", style);{ "fill": "#E8E8EA", "stroke": "#6E6E78", "stroke-width": "1", "r": "0", "states": { "hover": { "fill": "#F4F4F6", "stroke": "#6E6E78", "stroke-width": "1", "r": "0" } }, "style": { "color": "#4D5663", "fontSize": "12px", "fontFamily": "'Arial'", "fontWeight": "normal", "padding": "10px" } }- Type Parameters:
K- Type for the key, usually StringV- Type for the value, usually String. For nested maps, use Object or any other type.- Parameters:
style- the style object
-
getType
public String getType()
Returns the default series type for the chart. Can be any of the chart types listed underCharts.Default: "line".
-
setType
public void setType(String type)
Sets the default series type for the chart. Can be any of the chart types listed underCharts.- Parameters:
type- the default series type for the chart
-
getWidth
public Number getWidth()
Returns an explicit width for the chart. By default the width is calculated from the offset width of the containing element.Default: null.
-
setWidth
public void setWidth(Number width)
Sets an explicit width for the chart. By default the width is calculated from the offset width of the containing element.- Parameters:
width- an explicit width for the chart
-
setWidth
public void setWidth(String width)
Sets an explicit width for the chart. By default the width is calculated from the offset width of the containing element. Note: Percentage values (e.g., "100%") are not supported.- Parameters:
width- an explicit width for the chart- Since:
- 12.2.0.0
-
getZoomType
public String getZoomType()
Returns decides in what dimensions the user can zoom by dragging the mouse. Can be one ofx,yorxy.Default: null.
-
setZoomType
public void setZoomType(String zoomType)
Sets decides in what dimensions the user can zoom by dragging the mouse. Can be one ofx,yorxy.- Parameters:
zoomType- decides in what dimensions the user can zoom by dragging the mouse
-
isEnableZoomSelection
public Boolean isEnableZoomSelection()
Returns whether selection event will zoom the chart to the selected area.Default: true.
-
setEnableZoomSelection
public void setEnableZoomSelection(boolean enableZoomSelection)
Sets whether selection event will zoom the chart to the selected area.
-
-