Skip to content

ChartNode

abstract class ChartNode
Extends: Node
Package: dev.joid.lib.ui.node.impl.chart · Module: core · Source: ChartNode.java

Base class of a chart that shows named series of values over the labels of an X axis.

A line chart of one series from Mon to Fri

A chart draws nothing by itself: a subclass draws its data, and the chart computes the bounds of the scale. It waits until it has data and every series has a value, drawing its skeleton meanwhile.

ReturnsSignatureSummary
ChartNode(double x, double y, double width, double height) protectedCalled by a subclass with the position and the size of the chart.

PropertyTypeDefaultSummary
xAxis signalXChartAxisnullThe X axis: its labels and the series of the chart.
yAxis signalYChartAxisnullThe Y axis: its name and the prefix and suffix of its values.
Inherited from Node (24)

x · y · width · height · position · anchor · anchorX · anchorY · aspectRatio · zindex · zlevel · skeleton · visible · enabled · interactive · cursor · hoverDuration · hoverEquation · hover · overflow · scrollSpeed · scrollbar · label · draggable

ReturnsSignatureSummary
NumbergetMin()Bottom of the scale over every series: the smallest value, or 0 when every value is the same and positive.
NumbergetMin(String data)Bottom of the scale of one series.
NumbergetMax()Top of the scale over every series: the largest value, or 1 when every value is 0.
NumbergetMax(String data)Top of the scale of one series.
NumbergetAverage()Average of the averages of the series.
NumbergetAverage(String data)Average of one series.
Set<String>getLabels()The labels of the X axis.
ChartDatagetData(String data)The series of this name, or null.
Map<String,ChartData>getDataMap()Every series by name, in the order they were added; a read-only view.
ReturnsSignatureSummary
thisdata(String dataName, ChartData data) fluentAdds or replaces the series of this name.
thisremoveData(String data) fluentRemoves the series of this name.
ReturnsSignatureSummary
doublescaleMin(double min, double max) static protectedBottom of the scale for these smallest and largest values: the smallest, or 0 when both are equal and positive.
doublescaleMax(double min, double max) static protectedTop of the scale for these smallest and largest values: the largest, 0 when both are equal and negative, or 1 when both are 0.
Inherited from Node (128)

load · render · renderHover · updateScroll · updateScrollX · updateScrollY · append · attach · body · clearChildren · getChild · getChildren · getNodeListAt · getParent · isAttached · getAbsoluteX · getAbsoluteY · getAbsoluteDefaultX · getAbsoluteDefaultY · toDrawX · toDrawY · w · h · dw · dh · mw · mh · aw · ah · ax · ay · getDefaultWidth · getDefaultHeight · removeHover · clearHover · refreshHover · getResolvedCursor · hoverValue · getHoverAnimator · isHovered · handleMousePressed · handleMouseReleased · handleMouseDragged · handleMouseScroll · handleCharTyped · handleKeyPressed · handleKeyReleased · getLastClickTime · getLastClickButton · getLastKey · getLastKeyTime · scrollX · scrollY · scrollTo · beforeScroll · hasOverflowX · hasOverflowY · getOverflowArea · getScrollX · getScrollY · getTargetScrollX · getTargetScrollY · getMaxScrollX · getMaxScrollY · isScrollEndX · isScrollEndY · startDragging · stopDragging · beforeDragStart · beforeDragDrop · isDragging · getDragX · getDragY · isDragged · getDragSource · getDraggedNode · getStartDragX · getStartDragY · getTargetDragX · getTargetDragY · effect · removeEffect · clearEffects · hasEffect · getEffect · layer · clearLayers · animate · removeAnimator · wait · watch · hasListener · isVisibleProperty · isMounted · getIndex · getUi · getHierarchy · getMappedIndex · getTaskList · getShortcutList · toJson · toString · getEventBus · getBodyConsumer · getDefaultX · getDefaultY · getLayoutX · getLayoutY · getShiftX · getShiftY · isStepping · getLastCodepoint · getLoadCount · getRenderTime · remove · self · copy · useStore · addTask · removeTask · addShortcut · removeShortcut · layoutPosition · layoutSize · fit · move · beforeMove · hoverColor

Inherited from Node (21)

onUpdate · onDetach · onInit · onRender · onDraw · onMount · onHoverStart · onHover · onHoverEnd · onScroll · onScrollToEnd · onScrollEndReached · onDragStart · onDrag · onDragDrop · onDragSnap · onMove · onChildAppend · onClick · onAnimate · onWatch

ChartNode(double x, double y, double width, double height) protected

Called by a subclass with the position and the size of the chart. The chart throws an IllegalStateException when it is attached without an X axis or a Y axis.

  • this xAxis(XChartAxis xAxis) fluent
  • this xAxis(Supplier<XChartAxis> xAxis) fluent signal
  • XChartAxis getXAxis()

Default: null

The X axis: its labels and the series of the chart.

  • this yAxis(YChartAxis yAxis) fluent
  • this yAxis(Supplier<YChartAxis> yAxis) fluent signal
  • YChartAxis getYAxis()

Default: null

The Y axis: its name and the prefix and suffix of its values.

Number getMin()

Bottom of the scale over every series: the smallest value, or 0 when every value is the same and positive.

Number getMin(String data)

Bottom of the scale of one series.

Number getMax()

Top of the scale over every series: the largest value, or 1 when every value is 0.

Number getMax(String data)

Top of the scale of one series.

Number getAverage()

Average of the averages of the series.

Number getAverage(String data)

Average of one series.

Set<String> getLabels()

The labels of the X axis.

ChartData getData(String data)

The series of this name, or null.

Map<String,ChartData> getDataMap()

Every series by name, in the order they were added; a read-only view.

this data(String dataName, ChartData data) fluent

Throws:

  • IllegalStateException: The … has no X axis to hold the data …, call xAxis(…) before data(…)

Adds or replaces the series of this name. Throws an IllegalStateException when the chart has no X axis yet.

this removeData(String data) fluent

Throws:

  • IllegalStateException: The … has no X axis to remove the data … from, call xAxis(…) before removeData(…)

Removes the series of this name. Throws an IllegalStateException when the chart has no X axis yet.

double scaleMin(double min, double max) static protected

Bottom of the scale for these smallest and largest values: the smallest, or 0 when both are equal and positive.

double scaleMax(double min, double max) static protected

Top of the scale for these smallest and largest values: the largest, 0 when both are equal and negative, or 1 when both are 0.


fluent returns the instance, typed for chaining · factory creates an instance · signal also accepts a value that follows signals, as a signal, an expression or a lambda (When does JOID compute this value again?) · hook called by JOID, override it · abstract you implement it · default interface method with a body · static called on the class · protected visible to subclasses

Report a problem with this page