Package com.oorian.chartjs
Class CjDataPoint
java.lang.Object
com.oorian.chartjs.CjDataPoint
- All Implemented Interfaces:
com.oorian.json.Jsonable
Represents a data point for scatter and bubble charts.
For scatter charts, use x and y coordinates. For bubble charts, also include r (radius).
Usage:
// Scatter chart point
CjDataPoint point = CjDataPoint.of(10, 20);
// Bubble chart point with radius
CjDataPoint bubble = CjDataPoint.bubble(10, 20, 15);
-
Constructor Summary
ConstructorsConstructorDescriptionCjDataPoint(Number x, Number y) Creates a data point with x and y coordinates.CjDataPoint(Number x, Number y, Number r) Creates a data point with x, y coordinates and radius (for bubble charts). -
Method Summary
Modifier and TypeMethodDescriptionstatic CjDataPointCreates a bubble chart data point.getR()Gets the radius.getX()Gets the x-coordinate.getY()Gets the y-coordinate.voidinitFromJson(com.oorian.json.JsonValue json) static CjDataPointCreates a scatter chart data point.Sets the radius (for bubble charts).Sets the x-coordinate.Sets the y-coordinate.com.oorian.json.JsonValueMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.oorian.json.Jsonable
initFromJson, initFromJson, toJsonString
-
Constructor Details
-
CjDataPoint
Creates a data point with x and y coordinates.- Parameters:
x- The x-coordinatey- The y-coordinate
-
CjDataPoint
Creates a data point with x, y coordinates and radius (for bubble charts).- Parameters:
x- The x-coordinatey- The y-coordinater- The radius (bubble size)
-
-
Method Details
-
setX
Sets the x-coordinate.- Parameters:
x- The x-coordinate- Returns:
- This instance for method chaining
-
setY
Sets the y-coordinate.- Parameters:
y- The y-coordinate- Returns:
- This instance for method chaining
-
setR
Sets the radius (for bubble charts).- Parameters:
r- The radius- Returns:
- This instance for method chaining
-
getX
Gets the x-coordinate.- Returns:
- The x-coordinate
-
getY
Gets the y-coordinate.- Returns:
- The y-coordinate
-
getR
Gets the radius.- Returns:
- The radius, or null if not set
-
initFromJson
public void initFromJson(com.oorian.json.JsonValue json) - Specified by:
initFromJsonin interfacecom.oorian.json.Jsonable
-
toJsonValue
public com.oorian.json.JsonValue toJsonValue()- Specified by:
toJsonValuein interfacecom.oorian.json.Jsonable
-
of
Creates a scatter chart data point.- Parameters:
x- The x-coordinatey- The y-coordinate- Returns:
- A new CjDataPoint
-
bubble
Creates a bubble chart data point.- Parameters:
x- The x-coordinatey- The y-coordinater- The radius- Returns:
- A new CjDataPoint
-