Class DefaultMultiDimensionalChartModel

java.lang.Object
com.arbergashi.charts.model.DefaultMultiDimensionalChartModel
All Implemented Interfaces:
ChartModel, MultiDimensionalChartModel

public class DefaultMultiDimensionalChartModel extends Object implements MultiDimensionalChartModel
Default implementation for a multi-dimensional chart model.
Since:
2025-06-01
Version:
1.0.0
Author:
Arber Gashi
  • Constructor Details

    • DefaultMultiDimensionalChartModel

      public DefaultMultiDimensionalChartModel(List<double[]> data, List<String> dimensionLabels)
  • Method Details

    • getMultiDimensionalData

      public List<double[]> getMultiDimensionalData()
      Description copied from interface: MultiDimensionalChartModel
      Returns the data as a list of multi-dimensional points. Each point is represented by a double array.
      Specified by:
      getMultiDimensionalData in interface MultiDimensionalChartModel
      Returns:
      A list of double arrays.
    • getDimensionLabels

      public List<String> getDimensionLabels()
      Description copied from interface: MultiDimensionalChartModel
      Returns the labels for each dimension (axis). The length of this list should match the length of the double arrays.
      Specified by:
      getDimensionLabels in interface MultiDimensionalChartModel
      Returns:
      A list of dimension labels.
    • getName

      public String getName()
      Description copied from interface: ChartModel
      Returns the title of the data series.
      Specified by:
      getName in interface ChartModel
      Returns:
      Name of the series
    • setName

      public void setName(String name)
    • getColor

      public Color getColor()
      Description copied from interface: ChartModel
      Optional visual color for a series; default is null.
      Specified by:
      getColor in interface ChartModel
    • setColor

      public void setColor(Color color)
      Description copied from interface: ChartModel
      Optional setter for a visual color; default no-op.
      Specified by:
      setColor in interface ChartModel
    • getUpdateStamp

      public long getUpdateStamp()
      Description copied from interface: ChartModel
      Optional timestamp for model updates; default 0 for simple models.
      Specified by:
      getUpdateStamp in interface ChartModel
    • getPointCount

      public int getPointCount()
      Description copied from interface: ChartModel
      Returns the number of data points.
      Specified by:
      getPointCount in interface ChartModel
      Returns:
      count
    • getX

      public double getX(int index)
      Description copied from interface: ChartModel
      Returns the X value at the given index.
      Specified by:
      getX in interface ChartModel
      Parameters:
      index - data point index
      Returns:
      X value or 0.0 if out of range
    • getY

      public double getY(int index)
      Description copied from interface: ChartModel
      Returns the Y value at the given index.
      Specified by:
      getY in interface ChartModel
      Parameters:
      index - data point index
      Returns:
      Y value or 0.0 if out of range
    • addPoint

      public void addPoint(ChartPoint point)
    • addPoints

      public void addPoints(List<ChartPoint> points)
    • setPoints

      public void setPoints(List<ChartPoint> points)
    • clear

      public void clear()
    • addChangeListener

      public void addChangeListener(ChartModel.ChartModelListener listener)
      Description copied from interface: ChartModel
      Registers a listener for data changes.
      Specified by:
      addChangeListener in interface ChartModel
      Parameters:
      listener - The listener
    • removeChangeListener

      public void removeChangeListener(ChartModel.ChartModelListener listener)
      Description copied from interface: ChartModel
      Removes a listener.
      Specified by:
      removeChangeListener in interface ChartModel
      Parameters:
      listener - The listener