Class DataPoint


  • public final class DataPoint
    extends AbstractDataPoint
    Used for sparse datasets, such as those in scatter charts. Each data point is specified using an object containing x and y properties.
    Author:
    Andrea "Stock" Stocchero
    • Constructor Detail

      • DataPoint

        public DataPoint()
        Creates the object with an empty native object.
      • DataPoint

        public DataPoint​(double x,
                         double y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(Date x,
                         double y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(String x,
                         double y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(double x,
                         FloatingData y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(Date x,
                         FloatingData y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(String x,
                         FloatingData y)
        Creates the object with the passed point values.
        Parameters:
        x - x value of data point
        y - y value of data point
      • DataPoint

        public DataPoint​(double x,
                         double y,
                         double r)
        Creates the object with the passed point values (for bubble).
        Parameters:
        x - x value of data point
        y - y value of data point
        r - the bubble radius in pixels (not scaled).
      • DataPoint

        public DataPoint​(ItemsEnvelop<NativeObject> envelop)
        Creates the object with a native object passed as argument by and BaseEnvelop.
        This is called by the DataItem.
        Parameters:
        envelop - envelop which contains a native object with a data point
    • Method Detail

      • getXObjectType

        public ObjectType getXObjectType()
        Returns the object type of data stored as X.
        Returns:
        the object type of data stored as X
      • setX

        public void setX​(double x)
        Sets X value as double (for scatter and bubble datasets).
        Parameters:
        x - X value as double
      • getX

        public double getX()
        Returns X value as double (for scatter and bubble datasets).
        Returns:
        X value as double
      • setX

        public void setX​(Date x)
        Sets X value as date for time series.
        Parameters:
        x - X value as date for time series
      • getXAsDate

        public Date getXAsDate()
        Returns X value as date for time series.
        Returns:
        X value as date for time series or null if is not set
      • setX

        public void setX​(String x)
        Sets X value as string.
        Parameters:
        x - X value as string
      • getXAsString

        public String getXAsString()
        Returns X value as string.
        Returns:
        X value as string or Undefined.STRING if is not set
      • getYObjectType

        public ObjectType getYObjectType()
        Returns the object type of data stored as Y.
        Returns:
        the object type of data stored as Y
      • setY

        public void setY​(double y)
        Sets Y value.
        Parameters:
        y - Y value.
      • getY

        public double getY()
        Returns Y value.
        Returns:
        Y value.
      • setY

        public void setY​(FloatingData y)
        Sets Y value.
        Parameters:
        y - Y value.
      • getYAsFloatingData

        public FloatingData getYAsFloatingData()
        Returns Y value.
        Returns:
        Y value.
      • setR

        public void setR​(double r)
        Sets the bubble radius in pixels (not scaled).
        It is not scaled by the chart, it is the raw radius in pixels of the bubble that is drawn on the canvas.
        Parameters:
        r - the bubble radius in pixels (not scaled).
      • getR

        public double getR()
        Returns the bubble radius in pixels (not scaled).
        Returns:
        the bubble radius in pixels (not scaled).