Class BarDataset

    • Constructor Detail

      • BarDataset

        public BarDataset()
        Creates a data set.
        It uses the global options has default.
      • BarDataset

        public BarDataset​(boolean hidden)
        Creates a data set.
        It uses the global options has default.
        Parameters:
        hidden - if true, it will be initially hidden.
      • BarDataset

        public BarDataset​(IsDefaultOptions defaultValues)
        Creates the data set using a default.
        Parameters:
        defaultValues - default options
      • BarDataset

        public BarDataset​(IsDefaultOptions defaultValues,
                          boolean hidden)
        Creates the data set using a default.
        Parameters:
        defaultValues - default options
        hidden - if true, it will be initially hidden.
      • BarDataset

        protected BarDataset​(Type type,
                             boolean hidden)
        Creates the data set using chart type related to the data set.
        Parameters:
        type - chart type related to the data set
        hidden - if true, it will be initially hidden.
      • BarDataset

        protected BarDataset​(Type type,
                             IsDefaultOptions defaultValues,
                             boolean hidden)
        Creates the data set using a default and chart type related to the data set.
        Parameters:
        type - chart type related to the data set
        defaultValues - default options
        hidden - if true, it will be initially hidden.
    • Method Detail

      • getOrderHandler

        public final org.pepstock.charba.client.data.OrderHandler getOrderHandler()
      • getDefaultBackgroundColorAsString

        protected String getDefaultBackgroundColorAsString()
        Description copied from class: Dataset
        Returns the default background color value based on type of chart.
        Overrides:
        getDefaultBackgroundColorAsString in class Dataset
        Returns:
        the default background color value based on type of chart.
      • getDefaultBorderColorAsString

        protected String getDefaultBorderColorAsString()
        Description copied from class: Dataset
        Returns the default border color value based on type of chart.
        Overrides:
        getDefaultBorderColorAsString in class Dataset
        Returns:
        the default border color value based on type of chart.
      • getDefaultBorderWidth

        protected int getDefaultBorderWidth()
        Description copied from class: Dataset
        Returns the default border width value based on type of chart.
        Overrides:
        getDefaultBorderWidth in class Dataset
        Returns:
        the default border width value based on type of chart.
      • getDefaultHoverBackgroundColorAsString

        protected String getDefaultHoverBackgroundColorAsString()
        Description copied from class: Dataset
        Returns the default background color value based on type of chart.
        Overrides:
        getDefaultHoverBackgroundColorAsString in class Dataset
        Returns:
        the default background color value based on type of chart.
      • getDefaultHoverBorderColorAsString

        protected String getDefaultHoverBorderColorAsString()
        Description copied from class: Dataset
        Returns the default border color value based on type of chart.
        Overrides:
        getDefaultHoverBorderColorAsString in class Dataset
        Returns:
        the default border color value based on type of chart.
      • getDefaultHoverBorderWidth

        protected int getDefaultHoverBorderWidth()
        Description copied from class: Dataset
        Returns the default border width value based on type of chart.
        Overrides:
        getDefaultHoverBorderWidth in class Dataset
        Returns:
        the default border width value based on type of chart.
      • setBase

        public void setBase​(double... base)
        Sets the base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value.
        Parameters:
        base - base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value
      • getBase

        public List<Double> getBase()
        Returns the base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value.
        Returns:
        base value for the bar in data units along the value axis.
        If not set, defaults to the value axis base value
      • getLabel

        public String getLabel()
        Returns the label for the data set which appears in the legend and tooltips.
        Overrides:
        getLabel in class Dataset
        Returns:
        the label for the data set which appears in the legend and tooltips.
      • setXAxisID

        public void setXAxisID​(String xAxisID)
        Sets the ID of the x axis to plot this data set on.
        Parameters:
        xAxisID - the ID of the x axis to plot this data set on.
      • setXAxisID

        public void setXAxisID​(ScaleId xAxisID)
        Sets the ID of the x axis to plot this data set on.
        Parameters:
        xAxisID - the ID of the x axis to plot this data set on.
      • getXAxisID

        public ScaleId getXAxisID()
        Returns the ID of the x axis to plot this data set on.
        If not specified, this defaults to the ID of DefaultScaleId.X.
        Returns:
        the ID of the x axis to plot this data set on.
        If not specified, this defaults to the ID of DefaultScaleId.X
      • setYAxisID

        public void setYAxisID​(String yAxisID)
        Sets the ID of the y axis to plot this data set on.
        Parameters:
        yAxisID - the ID of the y axis to plot this data set on.
      • setYAxisID

        public void setYAxisID​(ScaleId yAxisID)
        Sets the ID of the y axis to plot this data set on.
        Parameters:
        yAxisID - the ID of the y axis to plot this data set on.
      • getYAxisID

        public ScaleId getYAxisID()
        Returns the ID of the y axis to plot this data set on.
        If not specified, this defaults to the ID of DefaultScaleId.Y.
        Returns:
        the ID of the y axis to plot this data set on.
        If not specified, this defaults to the ID of DefaultScaleId.Y
      • setIndexAxis

        public void setIndexAxis​(IndexAxis indexAxis)
        Sets the base axis for the data set.
        Use IndexAxis.Y for horizontal bar.
        Parameters:
        indexAxis - the base axis for the data set
      • getIndexAxis

        public IndexAxis getIndexAxis()
        Returns the base axis for the data set.
        Returns:
        the base axis for the data set
      • setBorderWidth

        public void setBorderWidth​(int... borderWidth)
        Sets the stroke width of the bar in pixels.
        Overrides:
        setBorderWidth in class HoverFlexDataset
        Parameters:
        borderWidth - the stroke width of the bar in pixels.
      • setBorderWidth

        public void setBorderWidth​(BarBorderWidth... borderWidth)
        Sets the stroke width of the bar in pixels.
        Parameters:
        borderWidth - the stroke width of the bar in pixels.
      • setBorderWidth

        public void setBorderWidth​(List<BarBorderWidth> borderWidth)
        Sets the stroke width of the bar in pixels.
        Parameters:
        borderWidth - the stroke width of the bar in pixels.
      • getBorderWidth

        public List<Integer> getBorderWidth()
        Returns the stroke width of the bar in pixels.
        If a callback has been set, returns an empty list.
        Overrides:
        getBorderWidth in class HoverFlexDataset
        Returns:
        list of the stroke width of the bar in pixels.
        If a callback has been set, returns an empty list.
      • getBorderWidthAsObjects

        public List<BarBorderWidth> getBorderWidthAsObjects()
        Returns the stroke width of the bar in pixels.
        If a callback or an array have been set, returns an empty object.
        Returns:
        list of the stroke width of the bar in pixels.
        If a callback or an array have been set, returns an empty object
      • setHoverBorderWidth

        public void setHoverBorderWidth​(int... borderWidth)
        Sets the stroke width of the elements when hovered.
        Overrides:
        setHoverBorderWidth in class HoverFlexDataset
        Parameters:
        borderWidth - the stroke width of the elements when hovered.
      • setHoverBorderWidth

        public void setHoverBorderWidth​(BarBorderWidth... borderWidth)
        Sets the stroke width of the bar in pixels, when hovered.
        Parameters:
        borderWidth - the stroke width of the bar in pixels, when hovered
      • setHoverBorderWidth

        public void setHoverBorderWidth​(List<BarBorderWidth> borderWidth)
        Sets the stroke width of the bar in pixels, when hovered.
        Parameters:
        borderWidth - the stroke width of the bar in pixels, when hovered
      • getHoverBorderWidth

        public List<Integer> getHoverBorderWidth()
        Returns the stroke width of the elements when hovered.
        Overrides:
        getHoverBorderWidth in class HoverFlexDataset
        Returns:
        list of the stroke width of the elements when hovered.
      • getHoverBorderWidthAsObjects

        public List<BarBorderWidth> getHoverBorderWidthAsObjects()
        Returns the stroke width of the bar in pixels, when hovered.
        Returns:
        list of the stroke width of the bar in pixels, when hovered
      • setBorderSkipped

        public void setBorderSkipped​(boolean borderskip)
        Sets the edge to skip drawing the border for.
        Parameters:
        borderskip - to set false as border skipped. If set true, is ignored
      • setBorderSkipped

        public void setBorderSkipped​(BorderSkipped... borderskips)
        Sets the edges to skip drawing the border for.
        Parameters:
        borderskips - array of the edges to skip drawing the border for.
      • setBorderSkipped

        public void setBorderSkipped​(List<BorderSkipped> borderskips)
        Sets the edges to skip drawing the border for.
        Parameters:
        borderskips - list of the edges to skip drawing the border for.
      • getBorderSkipped

        public List<BorderSkipped> getBorderSkipped()
        Returns the edges to skip drawing the border for.
        Returns:
        the edges to skip drawing the border for.
      • setBorderRadius

        public void setBorderRadius​(int... borderRadius)
        Sets the bar border radius (in pixels).
        Parameters:
        borderRadius - the bar border radius (in pixels).
      • setBorderRadius

        public void setBorderRadius​(BarBorderRadius... borderRadius)
        Sets the bar border radius (in pixels).
        Parameters:
        borderRadius - the bar border radius (in pixels).
      • setBorderRadius

        public void setBorderRadius​(List<BarBorderRadius> borderRadius)
        Sets the bar border radius (in pixels).
        Parameters:
        borderRadius - the bar border radius (in pixels).
      • getBorderRadius

        public List<Integer> getBorderRadius()
        Returns the list of bar border radius (in pixels).
        If a callback has been set, returns an empty list.
        Returns:
        the list of bar border radius (in pixels).
        If a callback has been set, returns an empty list
      • getBorderRadiusAsObjects

        public List<BarBorderRadius> getBorderRadiusAsObjects()
        Returns the list of bar border radius (in pixels).
        If a callback or an array have been set, returns an empty object.
        Returns:
        the list of bar border radius (in pixels).
        If a callback or an array have been set, returns an empty object
      • setHoverBorderRadius

        public void setHoverBorderRadius​(int... borderRadius)
        Sets the bar border radius (in pixels), when hovered.
        Parameters:
        borderRadius - the bar border radius (in pixels), when hovered.
      • setHoverBorderRadius

        public void setHoverBorderRadius​(BarBorderRadius... borderRadius)
        Sets the bar border radius (in pixels), when hovered.
        Parameters:
        borderRadius - Sets the bar border radius (in pixels), when hovered.
      • setHoverBorderRadius

        public void setHoverBorderRadius​(List<BarBorderRadius> borderRadius)
        Sets Sets the bar border radius (in pixels), when hovered.
        Parameters:
        borderRadius - Sets the bar border radius (in pixels), when hovered.
      • getHoverBorderRadius

        public List<Integer> getHoverBorderRadius()
        Returns the list of bar border radius (in pixels), when hovered.
        Returns:
        the list of bar border radius (in pixels), when hovered.
      • getHoverBorderRadiusAsObjects

        public List<BarBorderRadius> getHoverBorderRadiusAsObjects()
        Returns the list of bar border radius (in pixels), when hovered.
        Returns:
        the list of bar border radius (in pixels), when hovered.
      • getFloatingData

        public List<FloatingData> getFloatingData()
        Returns the data property of a data set for a chart is specified as an array of floating data.
        Returns:
        a list of floating data or an empty list if the data type is not DataType.ARRAYS.
      • getFloatingData

        public List<FloatingData> getFloatingData​(boolean binding)
        Returns the data property of a data set for a chart is specified as an array of floating data.
        Parameters:
        binding - if true binds the new array list in the container
        Returns:
        a list of floating data or an empty list if the data type is not DataType.ARRAYS.
      • setFloatingData

        public void setFloatingData​(double[][] floatingData)
        Sets the data property of a data set for a chart is specified as an array of arrays of doubles.
        Parameters:
        floatingData - an array of arrays of doubles.
      • setFloatingData

        public void setFloatingData​(FloatingData... floatingData)
        Sets the data property of a data set for a chart is specified as an array of floating data.
        Parameters:
        floatingData - an array of floating data
      • setFloatingData

        public void setFloatingData​(List<FloatingData> floatingData)
        Sets the data property of a data set for a chart is specified as an array of floating data.
        Parameters:
        floatingData - an array of floating data
      • getPointStyleType

        public PointStyleType getPointStyleType()
        Returns the type of point style.
        Returns:
        the type of point style
      • setPointStyle

        public void setPointStyle​(PointStyle pointStyle)
        Sets the style of the point for legend.
        Parameters:
        pointStyle - the style of the point for legend.
      • getPointStyle

        public PointStyle getPointStyle()
        Returns the style of the point for legend.
        Returns:
        the style of the point for legend.
      • setPointStyle

        public void setPointStyle​(Img pointStyle)
        Sets the style of the point for legend as image.
        Parameters:
        pointStyle - the style of the point for legend as image.
      • getPointStyleAsImage

        public Img getPointStyleAsImage()
        Returns the style of the point for legend as image.
        Returns:
        the style of the point for legend as image.
      • setPointStyle

        public void setPointStyle​(Canvas pointStyle)
        Sets the style of the point for legend as canvas.
        Parameters:
        pointStyle - the style of the point for legend as canvas.
      • getPointStyleAsCanvas

        public Canvas getPointStyleAsCanvas()
        Returns the style of the point for legend as canvas.
        Returns:
        the style of the point for legend as canvas.
      • setEnableBorderRadius

        public void setEnableBorderRadius​(boolean enableBorderRadius)
        If true, it only shows the borderRadius of a bar when the bar is at the end of the stack.
        Parameters:
        enableBorderRadius - if true, it only shows the borderRadius of a bar when the bar is at the end of the stack
      • isEnableBorderRadius

        public boolean isEnableBorderRadius()
        If true, it only shows the borderRadius of a bar when the bar is at the end of the stack.
        Returns:
        if true, it only shows the borderRadius of a bar when the bar is at the end of the stack
      • setAutoInflateAmount

        public void setAutoInflateAmount​(boolean autoInflateAmount)
        Sets true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.
        Parameters:
        autoInflateAmount - true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
      • isAutoInflateAmount

        public boolean isAutoInflateAmount()
        Returns true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated.
        Returns:
        true if the amount of pixels to inflate the bar rectangles, when drawing, is automatically calculated
      • setInflateAmount

        public void setInflateAmount​(int... inflateAmount)
        Sets the amount of pixels to inflate the bar rectangles, when drawing.
        Parameters:
        inflateAmount - the amount of pixels to inflate the bar rectangles, when drawing
      • getInflateAmount

        public List<Integer> getInflateAmount()
        Returns the amount of pixels to inflate the bar rectangles, when drawing.
        Returns:
        the amount of pixels to inflate the bar rectangles, when drawing
      • getBorderWidthCallback

        public BarBorderWidthCallback getBorderWidthCallback()
        Returns the border width callback, if set, otherwise null.
        Returns:
        the border width callback, if set, otherwise null.
      • setBorderWidth

        public void setBorderWidth​(BarBorderWidthCallback borderWidthCallback)
        Sets the border width callback.
        Parameters:
        borderWidthCallback - the border width callback to set
      • setBorderWidth

        public void setBorderWidth​(NativeCallback borderWidthCallback)
        Sets the border width callback.
        Parameters:
        borderWidthCallback - the border width callback to set
      • getHoverBorderWidthCallback

        public BarBorderWidthCallback getHoverBorderWidthCallback()
        Returns the hover border width callback, if set, otherwise null.
        Returns:
        the hover border width callback, if set, otherwise null.
      • setHoverBorderWidth

        public void setHoverBorderWidth​(BarBorderWidthCallback hoverBorderWidthCallback)
        Sets the hover border width callback.
        Parameters:
        hoverBorderWidthCallback - the hover border width callback to set
      • setHoverBorderWidth

        public void setHoverBorderWidth​(NativeCallback hoverBorderWidthCallback)
        Sets the hover border width callback.
        Parameters:
        hoverBorderWidthCallback - the hover border width callback to set
      • getBorderSkippedCallback

        public BorderSkippedCallback getBorderSkippedCallback()
        Returns the border skipped callback, if set, otherwise null.
        Returns:
        the border skipped callback, if set, otherwise null.
      • setBorderSkipped

        public void setBorderSkipped​(BorderSkippedCallback borderSkippedCallback)
        Sets the border skipped callback.
        Parameters:
        borderSkippedCallback - the border skipped callback to set
      • setBorderSkipped

        public void setBorderSkipped​(NativeCallback borderSkippedCallback)
        Sets the border skipped callback.
        Parameters:
        borderSkippedCallback - the border skipped callback to set
      • getBorderRadiusCallback

        public BorderRadiusCallback<DatasetContext> getBorderRadiusCallback()
        Returns the border radius callback, if set, otherwise null.
        Returns:
        the border radius callback, if set, otherwise null.
      • setBorderRadius

        public void setBorderRadius​(BorderRadiusCallback<DatasetContext> borderRadiusCallback)
        Sets the border radius callback.
        Parameters:
        borderRadiusCallback - the border radius callback to set
      • setBorderRadius

        public void setBorderRadius​(NativeCallback borderRadiusCallback)
        Sets the border radius callback.
        Parameters:
        borderRadiusCallback - the border radius callback to set
      • getHoverBorderRadiusCallback

        public BorderRadiusCallback<DatasetContext> getHoverBorderRadiusCallback()
        Returns the border radius callback, if set, otherwise null, when hovered.
        Returns:
        the border radius callback, if set, otherwise null, when hovered.
      • setHoverBorderRadius

        public void setHoverBorderRadius​(BorderRadiusCallback<DatasetContext> hoverBorderRadiusCallback)
        Sets the border radius callback, when hovered.
        Parameters:
        hoverBorderRadiusCallback - the border radius callback to set
      • setHoverBorderRadius

        public void setHoverBorderRadius​(NativeCallback hoverBorderRadiusCallback)
        Sets the border radius callback, when hovered.
        Parameters:
        hoverBorderRadiusCallback - the border radius callback to set
      • getPointStyleCallback

        public PointStyleCallback<DatasetContext> getPointStyleCallback()
        Returns the point style callback, if set, otherwise null.
        Returns:
        the point style callback, if set, otherwise null.
      • setPointStyle

        public void setPointStyle​(PointStyleCallback<DatasetContext> pointStyleCallback)
        Sets the point style callback.
        Parameters:
        pointStyleCallback - the point style callback.
      • setPointStyle

        public void setPointStyle​(NativeCallback pointStyleCallback)
        Sets the point style callback.
        Parameters:
        pointStyleCallback - the point style callback.
      • getBaseCallback

        public BaseCallback getBaseCallback()
        Returns the base callback, if set, otherwise null.
        Returns:
        the base callback, if set, otherwise null.
      • setBase

        public void setBase​(BaseCallback baseCallback)
        Sets the base callback.
        Parameters:
        baseCallback - the base callback.
      • setBase

        public void setBase​(NativeCallback baseCallback)
        Sets the base callback.
        Parameters:
        baseCallback - the base callback.
      • getEnableBorderRadiusCallback

        public EnableBorderRadiusCallback getEnableBorderRadiusCallback()
        Returns the enable border radius callback, if set, otherwise null.
        Returns:
        the enable border radius callback, if set, otherwise null.
      • setEnableBorderRadius

        public void setEnableBorderRadius​(EnableBorderRadiusCallback enableBorderRadiusCallback)
        Sets the enable border radius callback.
        Parameters:
        enableBorderRadiusCallback - the enable border radius callback.
      • setEnableBorderRadius

        public void setEnableBorderRadius​(NativeCallback enableBorderRadiusCallback)
        Sets the enable border radius callback.
        Parameters:
        enableBorderRadiusCallback - the enable border radius callback.
      • getInflateAmountCallback

        public InflateAmountCallback getInflateAmountCallback()
        Returns the inflate amount callback, if set, otherwise null.
        Returns:
        the inflate amount callback, if set, otherwise null.
      • setInflateAmount

        public void setInflateAmount​(InflateAmountCallback inflateAmountCallback)
        Sets the inflate amount callback.
        Parameters:
        inflateAmountCallback - the inflate amount callback.
      • setInflateAmount

        public void setInflateAmount​(NativeCallback inflateAmountCallback)
        Sets the inflate amount callback.
        Parameters:
        inflateAmountCallback - the inflate amount callback.
      • setOrder

        public default void setOrder​(int order)
        Sets the drawing order of dataset.
        Also affects order for stacking, tooltip, and legend.
        Parameters:
        order - the drawing order of dataset.
      • getOrder

        public default int getOrder()
        Returns the drawing order of dataset.
        Also affects order for stacking, tooltip, and legend.
        Returns:
        the drawing order of dataset