Class DefaultMultiDimensionalChartModel
java.lang.Object
com.arbergashi.charts.model.DefaultMultiDimensionalChartModel
- All Implemented Interfaces:
ChartModel, MultiDimensionalChartModel
Default implementation for a multi-dimensional chart model.
- Since:
- 2025-06-01
- Version:
- 1.0.0
- Author:
- Arber Gashi
-
Nested Class Summary
Nested classes/interfaces inherited from interface ChartModel
ChartModel.ChartModelListener -
Field Summary
Fields inherited from interface ChartModel
EMPTY_DOUBLE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultMultiDimensionalChartModel(List<double[]> data, List<String> dimensionLabels) -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters a listener for data changes.voidaddPoint(ChartPoint point) voidaddPoints(List<ChartPoint> points) voidclear()getColor()Optional visual color for a series; default is null.Returns the labels for each dimension (axis).List<double[]> Returns the data as a list of multi-dimensional points.getName()Returns the title of the data series.intReturns the number of data points.longOptional timestamp for model updates; default 0 for simple models.doublegetX(int index) Returns the X value at the given index.doublegetY(int index) Returns the Y value at the given index.voidRemoves a listener.voidOptional setter for a visual color; default no-op.voidvoidsetPoints(List<ChartPoint> points) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ChartModel
getDataRange, getHighData, getLabel, getLowData, getMax, getMin, getOpenData, getValue, getWeight, getWeightData, getXData, getY, getYData, isEmpty
-
Constructor Details
-
DefaultMultiDimensionalChartModel
-
-
Method Details
-
getMultiDimensionalData
Description copied from interface:MultiDimensionalChartModelReturns the data as a list of multi-dimensional points. Each point is represented by a double array.- Specified by:
getMultiDimensionalDatain interfaceMultiDimensionalChartModel- Returns:
- A list of double arrays.
-
getDimensionLabels
Description copied from interface:MultiDimensionalChartModelReturns the labels for each dimension (axis). The length of this list should match the length of the double arrays.- Specified by:
getDimensionLabelsin interfaceMultiDimensionalChartModel- Returns:
- A list of dimension labels.
-
getName
Description copied from interface:ChartModelReturns the title of the data series.- Specified by:
getNamein interfaceChartModel- Returns:
- Name of the series
-
setName
-
getColor
Description copied from interface:ChartModelOptional visual color for a series; default is null.- Specified by:
getColorin interfaceChartModel
-
setColor
Description copied from interface:ChartModelOptional setter for a visual color; default no-op.- Specified by:
setColorin interfaceChartModel
-
getUpdateStamp
public long getUpdateStamp()Description copied from interface:ChartModelOptional timestamp for model updates; default 0 for simple models.- Specified by:
getUpdateStampin interfaceChartModel
-
getPointCount
public int getPointCount()Description copied from interface:ChartModelReturns the number of data points.- Specified by:
getPointCountin interfaceChartModel- Returns:
- count
-
getX
public double getX(int index) Description copied from interface:ChartModelReturns the X value at the given index.- Specified by:
getXin interfaceChartModel- 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:ChartModelReturns the Y value at the given index.- Specified by:
getYin interfaceChartModel- Parameters:
index- data point index- Returns:
- Y value or 0.0 if out of range
-
addPoint
-
addPoints
-
setPoints
-
clear
public void clear() -
addChangeListener
Description copied from interface:ChartModelRegisters a listener for data changes.- Specified by:
addChangeListenerin interfaceChartModel- Parameters:
listener- The listener
-
removeChangeListener
Description copied from interface:ChartModelRemoves a listener.- Specified by:
removeChangeListenerin interfaceChartModel- Parameters:
listener- The listener
-