Class 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 boostThreshold that 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
    • Constructor Detail

      • Boost

        public Boost()
    • 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, the window.devicePixelRatio is used.

        Default: 1

      • setPixelRatio

        public void setPixelRatio​(Number pixelRatio)
        Sets the pixel ratio for the WebGL content. If 0, the window.devicePixelRatio is 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.