Package org.zkoss.chart
Class Boost
- java.lang.Object
-
- org.zkoss.chart.Optionable
-
- org.zkoss.chart.Boost
-
- All Implemented Interfaces:
Serializable,OptionDataListener,org.zkoss.json.JSONAware
public class Boost extends Optionable
Options for the Boost module. The Boost module allows certain series types to be rendered by WebGL instead of the default SVG. This allows hundreds of thousands of data points to be rendered in milliseconds. In addition to the WebGL rendering it saves time by skipping processing and inspection of the data wherever possible. This introduces some limitations to what features are available in boost mode.In addition to these chart-wide options, each series has a
boostThresholdthat defines when the boost should kick in.All the options in this class support
DynamicalAttribute.- Since:
- 13.1.1.0
- Author:
- peggypeng
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.zkoss.chart.Optionable
NOT_NULL_VALUE, options
-
-
Constructor Summary
Constructors Constructor Description Boost()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NumbergetChunkSize()Returns the number of points processed per frame when building the k-d tree for boosted series.NumbergetPixelRatio()Returns the pixel ratio for the WebGL content.NumbergetSeriesThreshold()Returns the series threshold for when the boost should kick in globally.BooleanisAllowForce()Returns whether the chart will be boosted, if one of the series crosses its threshold and all the series in the chart can be boosted.booleanisEnabled()Returns whether to enable boost on the chart.booleanisUseGPUTranslations()Returns whether to enable GPU translations.booleanisUsePreallocated()Returns whether to pre-allocate the vertex buffers.voidsetAllowForce(boolean allowForce)Sets whether the chart will be boosted, if one of the series crosses its threshold and all the series in the chart can be boosted.voidsetChunkSize(Number chunkSize)Sets the number of points processed per frame when building the k-d tree for boosted series.voidsetEnabled(boolean enabled)Sets whether to enable boost on the chart.voidsetPixelRatio(Number pixelRatio)Sets the pixel ratio for the WebGL content.voidsetSeriesThreshold(Number seriesThreshold)Sets the series threshold for when the boost should kick in globally.voidsetUseGPUTranslations(boolean useGPUTranslations)Sets whether to enable GPU translations.voidsetUsePreallocated(boolean usePreallocated)Sets whether to pre-allocate the vertex buffers.-
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
-
isAllowForce
public Boolean isAllowForce()
Returns whether the chart will be boosted, if one of the series crosses its threshold and all the series in the chart can be boosted.Default: null
-
setAllowForce
public void setAllowForce(boolean allowForce)
Sets whether the chart will be boosted, if one of the series crosses its threshold and all the series in the chart can be boosted.
-
getChunkSize
public Number getChunkSize()
Returns the number of points processed per frame when building the k-d tree for boosted series. Lower values improve responsiveness but increase the time it takes to build the tree.Default: 3000
-
setChunkSize
public void setChunkSize(Number chunkSize)
Sets the number of points processed per frame when building the k-d tree for boosted series. Lower values improve responsiveness but increase the time it takes to build the tree.
-
isEnabled
public boolean isEnabled()
Returns whether to enable boost on the chart.Default: true
-
setEnabled
public void setEnabled(boolean enabled)
Sets whether to enable boost on the chart.
-
getPixelRatio
public Number getPixelRatio()
Returns the pixel ratio for the WebGL content. If 0, thewindow.devicePixelRatiois used.Default: 1
-
setPixelRatio
public void setPixelRatio(Number pixelRatio)
Sets the pixel ratio for the WebGL content. If 0, thewindow.devicePixelRatiois used, which keeps the graphics sharp on high DPI displays. Set it to 2 to make exported and upscaled charts render sharp.
-
getSeriesThreshold
public Number getSeriesThreshold()
Returns the series threshold for when the boost should kick in globally. For example, 20 causes the whole chart to enter boost mode if there are 20 or more series active.Default: 50
-
setSeriesThreshold
public void setSeriesThreshold(Number seriesThreshold)
Sets the series threshold for when the boost should kick in globally. For example, 20 causes the whole chart to enter boost mode if there are 20 or more series active.
-
isUseGPUTranslations
public boolean isUseGPUTranslations()
Returns whether to enable GPU translations. GPU translations are faster than doing the translation in JavaScript, but may cause rendering issues with large numbers that have small increments, such as timestamps.Default: false
-
setUseGPUTranslations
public void setUseGPUTranslations(boolean useGPUTranslations)
Sets whether to enable GPU translations. GPU translations are faster than doing the translation in JavaScript, but may cause rendering issues with large numbers that have small increments, such as timestamps.
-
isUsePreallocated
public boolean isUsePreallocated()
Returns whether to pre-allocate the vertex buffers. It is faster, but experimental, and may cause visual artifacts with some datasets.Default: false
-
setUsePreallocated
public void setUsePreallocated(boolean usePreallocated)
Sets whether to pre-allocate the vertex buffers. It is faster, but experimental, and may cause visual artifacts with some datasets.
-
-