Class DatasetCanvasObjectFactory


  • public final class DatasetCanvasObjectFactory
    extends CanvasObjectFactory
    Utility class which creates a canvas gradient and pattern java script objects using a Charba gradient or pattern.
    A Charba gradient or pattern describes how a canvas gradient or pattern must be created.
    Author:
    Andrea "Stock" Stocchero
    See Also:
    Gradient, Pattern, CanvasGradientItem, CanvasPatternItem
    • Method Detail

      • getArea

        protected Area getArea​(IsChart chart,
                               Gradient gradient)
        Description copied from class: CanvasObjectFactory
        Returns an area object used to define the area of LINEAR gradient.
        Specified by:
        getArea in class CanvasObjectFactory
        Parameters:
        chart - chart instance
        gradient - gradient instance
        Returns:
        an area object used to define the area of LINEAR gradient
      • getCenter

        protected Center getCenter​(IsChart chart,
                                   Gradient gradient,
                                   int datasetIndex)
        Description copied from class: CanvasObjectFactory
        Returns the coordinates of a center of arc for RADIAL gradient.
        Specified by:
        getCenter in class CanvasObjectFactory
        Parameters:
        chart - chart instance
        gradient - gradient instance
        datasetIndex - data set index
        Returns:
        the coordinates of a center of arc
      • getRadius

        protected Radius getRadius​(IsChart chart,
                                   Gradient gradient,
                                   int datasetIndex)
        Description copied from class: CanvasObjectFactory
        Returns the inner and outer radius of arc for RADIAL gradient.
        Specified by:
        getRadius in class CanvasObjectFactory
        Parameters:
        chart - chart instance
        gradient - gradient instance
        datasetIndex - data set index
        Returns:
        the inner and outer radius of arc