Class Line

    • Constructor Detail

      • Line

        protected Line​(Elements elements,
                       Key childKey,
                       IsDefaultLine defaultValues,
                       NativeObject nativeObject)
        Creates the object with the parent, the key of this element, default values and native object to map java script properties.
        Parameters:
        elements - parent node to use to add this element where changed
        childKey - the property name of this element to use to add it to the parent.
        defaultValues - default provider
        nativeObject - native object to map java script properties
    • Method Detail

      • getFillHandler

        public FillHandler getFillHandler()
        Description copied from interface: HasFill
        Returns a fill handler instance to use in the default methods of this interface.
        Specified by:
        getFillHandler in interface HasFill
        Returns:
        a fill handler instance
      • setTension

        public void setTension​(double tension)
        Returns the Bézier curve tension (0 for no Bézier curves).
        Parameters:
        tension - the Bézier curve tension (0 for no Bézier curves).
      • getTension

        public double getTension()
        Returns the Bézier curve tension (0 for no Bézier curves).
        Specified by:
        getTension in interface IsDefaultLine
        Returns:
        the Bézier curve tension (0 for no Bézier curves).
      • setBorderCapStyle

        public void setBorderCapStyle​(CapStyle borderCapStyle)
        Sets how the end points of every line are drawn.
        Parameters:
        borderCapStyle - how the end points of every line are drawn.
      • getBorderCapStyle

        public CapStyle getBorderCapStyle()
        Returns how the end points of every line are drawn.
        Specified by:
        getBorderCapStyle in interface IsDefaultLine
        Returns:
        how the end points of every line are drawn.
      • setBorderDash

        public void setBorderDash​(int... borderDash)
        Sets the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Parameters:
        borderDash - the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • getBorderDash

        public List<Integer> getBorderDash()
        Returns the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
        Returns:
        the line dash pattern used when stroking lines, using an array of values which specify alternating lengths of lines and gaps which describe the pattern.
      • setBorderDashOffset

        public void setBorderDashOffset​(double borderDashOffset)
        Sets the line dash pattern offset.
        Parameters:
        borderDashOffset - the line dash pattern offset.
      • getBorderDashOffset

        public double getBorderDashOffset()
        Returns the line dash pattern offset.
        Specified by:
        getBorderDashOffset in interface IsDefaultLine
        Returns:
        the line dash pattern offset.
      • setBorderJoinStyle

        public void setBorderJoinStyle​(JoinStyle borderJoinStyle)
        Sets how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
        Parameters:
        borderJoinStyle - how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
      • getBorderJoinStyle

        public JoinStyle getBorderJoinStyle()
        Returns how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together (degenerate segments with zero lengths, whose specified end points and control points are exactly at the same position, are skipped).
        Specified by:
        getBorderJoinStyle in interface IsDefaultLine
        Returns:
        how two connecting segments (of lines, arcs or curves) with non-zero lengths in a shape are joined together
      • setCapBezierPoints

        public void setCapBezierPoints​(boolean capBezierPoints)
        Sets true to keep Bézier control inside the chart, false for no restriction.
        Parameters:
        capBezierPoints - true to keep Bézier control inside the chart, false for no restriction.
      • isCapBezierPoints

        public boolean isCapBezierPoints()
        Returns true to keep Bézier control inside the chart, false for no restriction.
        Specified by:
        isCapBezierPoints in interface IsDefaultLine
        Returns:
        true to keep Bézier control inside the chart, false for no restriction.
      • setCubicInterpolationMode

        public void setCubicInterpolationMode​(CubicInterpolationMode mode)
        Sets algorithm used to interpolate a smooth curve from the discrete data points.
        The following interpolation modes are supported:

         'default'
         'monotone'
         

        The 'default' algorithm uses a custom weighted cubic interpolation, which produces pleasant curves for all types of datasets.
        The 'monotone' algorithm is more suited to y = f(x) datasets : it preserves monotonicity (or piecewise monotonicity) of the dataset being interpolated, and ensures local extremums (if any) stay at input data points.
        Parameters:
        mode - algorithm used to interpolate a smooth curve from the discrete data points
      • getCubicInterpolationMode

        public CubicInterpolationMode getCubicInterpolationMode()
        Returns algorithm used to interpolate a smooth curve from the discrete data points.
        Specified by:
        getCubicInterpolationMode in interface IsDefaultLine
        Returns:
        algorithm used to interpolate a smooth curve from the discrete data points.
      • setStepped

        public void setStepped​(boolean line)
        Sets if the line is shown as a stepped line.
        If the stepped value is set to anything other than false, tension will be ignored.
        Parameters:
        line - if the line is shown as a stepped line. false is no step interpolation
      • setStepped

        public void setStepped​(Stepped line)
        Sets if the line is shown as a stepped line.
        If the stepped value is set to anything other than false, tension will be ignored.
        Parameters:
        line - if the line is shown as a stepped line.
      • getStepped

        public Stepped getStepped()
        Returns if the line is shown as a stepped line.
        Specified by:
        getStepped in interface IsDefaultLine
        Returns:
        If the line is shown as a stepped line.