Class AbstractScale

    • Constructor Detail

      • AbstractScale

        protected AbstractScale​(IsDefaultScale defaultValues,
                                NativeObject nativeObject)
        Creates the object only with default provider and native object. This is used when the scale is the root element.
        Parameters:
        defaultValues - default provider instance.
        nativeObject - native object to store properties.
    • Method Detail

      • getLabelsHandler

        public final LabelsHandler getLabelsHandler()
        Description copied from interface: HasLabels
        Returns an labels option handler instance.
        Specified by:
        getLabelsHandler in interface HasLabels
        Returns:
        an labels option handler instance
      • getBorder

        public final ScaleBorder getBorder()
        Returns the scale border element.
        Specified by:
        getBorder in interface IsDefaultScale
        Returns:
        the scale border element
      • getTitle

        public final ScaleTitle getTitle()
        Returns the scale title element.
        Specified by:
        getTitle in interface IsDefaultScale
        Returns:
        the scale title element
      • getTicks

        public final Ticks getTicks()
        Returns the ticks element.
        Specified by:
        getTicks in interface IsDefaultScale
        Returns:
        the ticks
      • getGrid

        public final Grid getGrid()
        Returns the grid element.
        Specified by:
        getGrid in interface IsDefaultScale
        Returns:
        the grid
      • getTime

        public final Time getTime()
        Returns the time element.
        Specified by:
        getTime in interface IsDefaultScale
        Returns:
        the time
      • setBeginAtZero

        public final void setBeginAtZero​(boolean beginAtZero)
        If true, scale will include 0 if it is not already included.
        Parameters:
        beginAtZero - if true, scale will include 0 if it is not already included.
      • isBeginAtZero

        public final boolean isBeginAtZero()
        If true, scale will include 0 if it is not already included.
        Specified by:
        isBeginAtZero in interface IsDefaultScale
        Returns:
        if true, scale will include 0 if it is not already included.
      • setBackgroundColor

        public void setBackgroundColor​(IsColor backgroundColor)
        Sets the default background color to use in the chart, on all objects, if not override by the specific configuration.
        Parameters:
        backgroundColor - background color to use in the chart.
      • setBackgroundColor

        public void setBackgroundColor​(String backgroundColor)
        Sets the background color of the scale area.
        Parameters:
        backgroundColor - the background color of the scale area.
      • getBackgroundColorAsString

        public String getBackgroundColorAsString()
        Returns the background color of the scale area.
        Specified by:
        getBackgroundColorAsString in interface IsDefaultScale
        Returns:
        the background color of the scale area.
      • getBackgroundColor

        public IsColor getBackgroundColor()
        Returns the background color of the scale area.
        Returns:
        the background color of the scale area.
      • setGrace

        public final void setGrace​(int grace)
        Sets the value in pixels is added to the maximum data value and subtracted from the minimum data.
        This extends the scale range as if the data values were that much greater.
        Parameters:
        grace - the value in pixels is added to the maximum data value and subtracted from the minimum data
      • getGrace

        public final int getGrace()
        Returns the value in pixels is added to the maximum data value and subtracted from the minimum data.
        This extends the scale range as if the data values were that much greater.
        Specified by:
        getGrace in interface IsDefaultScale
        Returns:
        the value in pixels is added to the maximum data value and subtracted from the minimum data
      • setGraceAsPercentage

        public final void setGraceAsPercentage​(double grace)
        Sets the value in percentage, value between 0 and 1, is added to the maximum data value and subtracted from the minimum data.
        This extends the scale range as if the data values were that much greater.
        Parameters:
        grace - the value in percentage is added to the maximum data value and subtracted from the minimum data
      • getGraceAsPercentage

        public final double getGraceAsPercentage()
        Returns the value in percentage, value between 0 and 1, is added to the maximum data value and subtracted from the minimum data.
        This extends the scale range as if the data values were that much greater.
        Specified by:
        getGraceAsPercentage in interface IsDefaultScale
        Returns:
        the value in percentage is added to the maximum data value and subtracted from the minimum data
      • setMin

        public final void setMin​(double min)
        Sets the user defined minimum number for the scale, overrides minimum value from data.
        Parameters:
        min - the user defined minimum number for the scale, overrides minimum value from data.
      • getMin

        public final double getMin()
        Returns the user defined minimum number for the scale, overrides minimum value from data.
        Specified by:
        getMin in interface IsDefaultScale
        Returns:
        the user defined minimum number for the scale, overrides minimum value from data.
      • setMin

        public final void setMin​(Date min)
        If defined, this will override the data minimum.
        Parameters:
        min - If defined, this will override the data minimum.
      • getMinAsDate

        public final Date getMinAsDate()
        If defined, this will override the data minimum.
        Returns:
        If defined, this will override the data minimum.
      • setMax

        public final void setMax​(double max)
        Sets the user defined maximum number for the scale, overrides maximum value from data.
        Parameters:
        max - user defined maximum number for the scale, overrides maximum value from data.
      • getMax

        public final double getMax()
        Returns the user defined maximum number for the scale, overrides maximum value from data.
        Specified by:
        getMax in interface IsDefaultScale
        Returns:
        user defined maximum number for the scale, overrides maximum value from data.
      • setMax

        public final void setMax​(Date max)
        If defined, this will override the data maximum.
        Parameters:
        max - if defined, this will override the data maximum.
      • getMaxAsDate

        public final Date getMaxAsDate()
        If defined, this will override the data maximum.
        Returns:
        if defined, this will override the data maximum.
      • setMin

        public final void setMin​(String min)
        Sets the user defined minimum number for the scale, overrides minimum value from data.
        Parameters:
        min - the user defined minimum number for the scale, overrides minimum value from data.
      • getMinAsString

        public final String getMinAsString()
        Returns the user defined minimum number for the scale, overrides minimum value from data.
        Returns:
        the user defined minimum number for the scale, overrides minimum value from data.
      • setMax

        public final void setMax​(String max)
        Sets the user defined maximum number for the scale, overrides maximum value from data.
        Parameters:
        max - user defined maximum number for the scale, overrides maximum value from data.
      • getMaxAsString

        public final String getMaxAsString()
        Returns the user defined maximum number for the scale, overrides maximum value from data.
        Returns:
        user defined maximum number for the scale, overrides maximum value from data.
      • setMinIndex

        public final void setMinIndex​(int min)
        Sets the minimum item at passed index to display.
        Parameters:
        min - The minimum item at passed index to display
      • getMinIndex

        public final int getMinIndex()
        Returns the minimum item at passed index to display
        Returns:
        The minimum item at passed index to display
      • setMaxIndex

        public final void setMaxIndex​(int max)
        Sets the maximum item at passed index to display.
        Parameters:
        max - the maximum item at passed index to display.
      • getMaxIndex

        public final int getMaxIndex()
        Returns the maximum item at passed index to display.
        Returns:
        the maximum item at passed index to display.
      • setSuggestedMax

        public final void setSuggestedMax​(double suggestedMax)
        Sets the adjustment used when calculating the maximum data value.
        Parameters:
        suggestedMax - adjustment used when calculating the maximum data value.
      • getSuggestedMax

        public final double getSuggestedMax()
        Returns the adjustment used when calculating the maximum data value.
        Specified by:
        getSuggestedMax in interface IsDefaultScale
        Returns:
        adjustment used when calculating the maximum data value.
      • setSuggestedMin

        public final void setSuggestedMin​(double suggestedMin)
        Sets the adjustment used when calculating the minimum data value.
        Parameters:
        suggestedMin - adjustment used when calculating the minimum data value.
      • getSuggestedMin

        public final double getSuggestedMin()
        Returns the adjustment used when calculating the minimum data value.
        Specified by:
        getSuggestedMin in interface IsDefaultScale
        Returns:
        adjustment used when calculating the minimum data value.
      • setAlignToPixels

        public final void setAlignToPixels​(boolean alignToPixels)
        Sets true to align pixel values to device pixels.
        Parameters:
        alignToPixels - true to align pixel values to device pixels.
      • isAlignToPixels

        public final boolean isAlignToPixels()
        Returns true to align pixel values to device pixels.
        Specified by:
        isAlignToPixels in interface IsDefaultScale
        Returns:
        true to align pixel values to device pixels
      • setReverse

        public final void setReverse​(boolean reverse)
        Sets the reversed order of tick labels.
        Parameters:
        reverse - reversed order of tick labels.
      • isReverse

        public final boolean isReverse()
        Returns the reversed order of tick labels.
        Specified by:
        isReverse in interface IsDefaultScale
        Returns:
        if true reversed order of tick labels.
      • setStacked

        public final void setStacked​(boolean stacked)
        Sets if the axis are stacked or not.
        Parameters:
        stacked - if the axis are stacked or not.
      • isStacked

        public final boolean isStacked()
        Returns if the axis are stacked or not.
        Specified by:
        isStacked in interface IsDefaultScale
        Returns:
        if the axis are stacked or not.
      • setSingleStacked

        public final void setSingleStacked​(boolean stacked)
        Sets if you might want to stack positive and negative values together.
        Parameters:
        stacked - if you might want to stack positive and negative values together
      • isSingleStacked

        public final boolean isSingleStacked()
        Returns if you might want to stack positive and negative values together.
        Specified by:
        isSingleStacked in interface IsDefaultScale
        Returns:
        if you might want to stack positive and negative values together
      • setWeight

        public final void setWeight​(double weight)
        The weight used to sort the axis. Higher weights are further away from the chart area.
        Parameters:
        weight - weight of axis
      • getWeight

        public final double getWeight()
        The weight used to sort the axis. Higher weights are further away from the chart area.
        Specified by:
        getWeight in interface IsDefaultScale
        Returns:
        weight of axis.
      • setDisplay

        public final void setDisplay​(boolean display)
        If true, shows the axis.
        Parameters:
        display - if true, shows the axes.
      • setDisplay

        public final void setDisplay​(Display display)
        The display option controls the visibility of axis.
        Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the axis is visible only if at least one associated dataset is visible.
        Parameters:
        display - display option controls the visibility of axis
      • getDisplay

        public final Display getDisplay()
        The display option controls the visibility of axis.
        Controls the axis global visibility (visible when true, hidden when false). When display: 'auto', the axis is visible only if at least one associated dataset is visible.
        Specified by:
        getDisplay in interface IsDefaultScale
        Returns:
        display option controls the visibility of axis
      • setOffset

        public final void setOffset​(boolean offset)
        If true, extra space is added to the both edges and the axis is scaled to fit in the chart area.
        Parameters:
        offset - extra space of axis
      • isOffset

        public final boolean isOffset()
        If true, extra space is added to the both edges and the axis is scaled to fit in the chart area.
        Specified by:
        isOffset in interface IsDefaultScale
        Returns:
        extra space of axis.
      • setPosition

        public final void setPosition​(AxisPosition position)
        An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.
        To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.
        To position the axis at the center of the chart area, set the position option to 'center'.
        Parameters:
        position - position of axis
      • getPosition

        public final AxisPosition getPosition()
        An axis can either be positioned at the edge of the chart, at the center of the chart area, or dynamically with respect to a data value.
        To position the axis at the edge of the chart, set the position option to one of: 'top', 'left', 'bottom', 'right'.
        To position the axis at the center of the chart area, set the position option to 'center'.
        Specified by:
        getPosition in interface IsDefaultScale
        Returns:
        position of axis.
      • setPosition

        public final void setPosition​(AxisPositionItem position)
        Sets the position of the axis at a specific value of another axis.
        Parameters:
        position - position of axis
      • setBounds

        public final void setBounds​(Bounds bounds)
        Sets the property controls the scale boundary strategy (bypassed by min/max time options).
        Parameters:
        bounds - property controls the scale boundary strategy (bypassed by min/max time options).
      • getBounds

        public final Bounds getBounds()
        Returns the property controls the scale boundary strategy (bypassed by min/max time options).
        Specified by:
        getBounds in interface IsDefaultScale
        Returns:
        property controls the scale boundary strategy (bypassed by min/max time options).
      • setStack

        public final void setStack​(String stack)
        Sets the stack group.
        Axes at the same position with same stack are stacked.
        Parameters:
        stack - the stack group.
        Axes at the same position with same stack are stacked
      • getStack

        public final String getStack()
        Returns the stack group.
        Axes at the same position with same stack are stacked.
        Specified by:
        getStack in interface IsDefaultScale
        Returns:
        the stack group.
        Axes at the same position with same stack are stacked
      • setStackWeight

        public final void setStackWeight​(double stackWeight)
        Sets the weight of the scale in stack group.
        Used to determine the amount of allocated space for the scale within the group.
        Parameters:
        stackWeight - the weight of the scale in stack group.
        Used to determine the amount of allocated space for the scale within the group.
      • getStackWeight

        public final double getStackWeight()
        Returns the weight of the scale in stack group.
        Used to determine the amount of allocated space for the scale within the group.
        Specified by:
        getStackWeight in interface IsDefaultScale
        Returns:
        the weight of the scale in stack group.
        Used to determine the amount of allocated space for the scale within the group
      • setLabels

        public final void setLabels​(String... labels)
        Sets the labels of the data.
        Specified by:
        setLabels in interface HasLabels
        Parameters:
        labels - array of labels
      • setLabels

        public final void setLabels​(Labels labels)
        Sets the labels of the data.
        Specified by:
        setLabels in interface HasLabels
        Parameters:
        labels - labels object to manage also multi-line labels
      • setAnimate

        public final void setAnimate​(boolean animate)
        Sets whether to animate scaling the chart from the center.
        Parameters:
        animate - whether to animate scaling the chart from the center.
      • isAnimate

        public final boolean isAnimate()
        Returns whether to animate scaling the chart from the center.
        Specified by:
        isAnimate in interface IsDefaultScale
        Returns:
        whether to animate scaling the chart from the center.
      • setStartAngle

        public void setStartAngle​(double startAngle)
        Sets the starting angle to draw arcs for the first item in a data set.
        Parameters:
        startAngle - starting angle to draw arcs for the first item in a data set.
      • getStartAngle

        public double getStartAngle()
        Returns the starting angle to draw arcs for the first item in a data set.
        Specified by:
        getStartAngle in interface IsDefaultScale
        Returns:
        starting angle to draw arcs for the first item in a data set.
      • setOffsetAfterAutoskip

        public final void setOffsetAfterAutoskip​(boolean offsetAfterAutoskip)
        If true, bar chart offsets are computed with auto skipped ticks..
        Parameters:
        offsetAfterAutoskip - if true, bar chart offsets are computed with auto skipped ticks..
      • isOffsetAfterAutoskip

        public final boolean isOffsetAfterAutoskip()
        If true, bar chart offsets are computed with auto skipped ticks..
        Specified by:
        isOffsetAfterAutoskip in interface IsDefaultScale
        Returns:
        if true, bar chart offsets are computed with auto skipped ticks..