X
- type of X valuesY
- type of Y valuespublic class HeatMapChart<X,Y> extends Chart
public void start(Stage primaryStage) {
primaryStage.setTitle("HeatMapChart Sample");
NumericAxis xAxis = new NumericAxis();
xAxis.setAnimated(false);
xAxis.setAutoRangeRounding(false);
xAxis.setLabel("X Position");
NumericAxis yAxis = new NumericAxis();
yAxis.setAnimated(false);
yAxis.setAutoRangeRounding(false);
yAxis.setLabel("Y Position");
HeatMapChart<Number, Number> chart = new HeatMapChart<>(xAxis, yAxis);
chart.setTitle("Beam Image");
// readImage() creates an instance of HeatMapChart.Data
chart.setData(readImage());
chart.setLegendVisible(true);
chart.setLegendSide(Side.RIGHT);
Scene scene = new Scene(chart, 800, 600);
primaryStage.setScene(scene);
primaryStage.show();
}
The colors to be used for values encoding can be specified via colorGradientProperty()
which by default is
initialized to HeatMapChart.ColorGradient.RAINBOW
.
By default the gradient colors are adapted to the min/max of the data to be displayed i.e. minimum values are encoded
with color of the first Stop
and the maximum values are encoded with the color of
the last Stop
. This can be changed by setting appropriate
lower
and upper
bound on the
Z axis
.
Type | Property and Description |
---|---|
ObjectProperty<HeatMapChart.ColorGradient> |
colorGradient
Color gradient (linear) used to encode data point values.
|
ObjectProperty<HeatMapChart.DataOriginPointLocation> |
dataOriginPointLocation
Indicates how the chart will be drawn in terms of it's origin point - i.e.
|
ObjectProperty<HeatMapChart.Data<X,Y>> |
data
HeatMapChart data.
|
BooleanProperty |
horizontalGridLinesVisible
Indicates whether horizontal grid lines are visible or not.
|
BooleanProperty |
smooth
Indicates if the chart should smooth colors between data points or render each data point as a rectangle with
uniform color.
|
BooleanProperty |
verticalGridLinesVisible
Indicates whether vertical grid lines are visible or not.
|
animatedProperty, legendProperty, legendSideProperty, legendVisibleProperty, titleProperty, titleSideProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, heightProperty, insetsProperty, maxHeightProperty, maxWidthProperty, minHeightProperty, minWidthProperty, opaqueInsetsProperty, paddingProperty, prefHeightProperty, prefWidthProperty, scaleShapeProperty, shapeProperty, snapToPixelProperty, widthProperty
impl_traversalEngineProperty, needsLayoutProperty
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, cacheHintProperty, cacheProperty, clipProperty, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, focusedProperty, focusTraversableProperty, hoverProperty, idProperty, impl_showMnemonicsProperty, impl_treeVisibleProperty, inputMethodRequestsProperty, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParentTransformProperty, localToSceneTransformProperty, managedProperty, mouseTransparentProperty, nodeOrientationProperty, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, pickOnBoundsProperty, pressedProperty, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, styleProperty, translateXProperty, translateYProperty, translateZProperty, visibleProperty
Modifier and Type | Class and Description |
---|---|
static class |
HeatMapChart.AbstractData<X,Y>
Abstract data implementing
Observable interface. |
static class |
HeatMapChart.ColorGradient
ColorGradient class provides colors to encode data values. |
static interface |
HeatMapChart.Data<X,Y>
Heat map data.
|
static class |
HeatMapChart.DataOriginPointLocation
Defines possible location of chart origin, i.e.
|
static class |
HeatMapChart.DefaultData<X,Y>
HeatMapChart.Data implementation based on arrays. |
USE_COMPUTED_SIZE, USE_PREF_SIZE
BASELINE_OFFSET_SAME_AS_HEIGHT
Constructor and Description |
---|
HeatMapChart(Axis<X> xAxis,
Axis<Y> yAxis)
Construct a new HeatMapChart with the given axis.
|
Modifier and Type | Method and Description |
---|---|
ObjectProperty<HeatMapChart.ColorGradient> |
colorGradientProperty()
Color gradient (linear) used to encode data point values.
|
ObjectProperty<HeatMapChart.DataOriginPointLocation> |
dataOriginPointLocationProperty()
Indicates how the chart will be drawn in terms of it's origin point - i.e.
|
ObjectProperty<HeatMapChart.Data<X,Y>> |
dataProperty()
HeatMapChart data.
|
static List<CssMetaData<? extends Styleable,?>> |
getClassCssMetaData() |
HeatMapChart.ColorGradient |
getColorGradient()
Returns the value of the
colorGradientProperty() . |
List<CssMetaData<? extends Styleable,?>> |
getCssMetaData() |
HeatMapChart.Data<X,Y> |
getData()
Returns the value of the
dataProperty() . |
HeatMapChart.DataOriginPointLocation |
getDataOriginPoint()
Returns the value of the
dataOriginPointLocationProperty() |
Bounds |
getPlotAreaBoundsInLocal()
Returns bounds of plot area in the it's untransformed local coordinate space.
|
Bounds |
getPlotAreaBoundsInParent()
Returns rectangular bounds of this chart's plot area which include its transforms.
|
Axis<X> |
getXAxis()
Returns the x axis.
|
Axis<Y> |
getYAxis()
Returns the y axis.
|
NumericAxis |
getZAxis()
Returns the Z axis representing scale of
Data Z values . |
BooleanProperty |
horizontalGridLinesVisibleProperty()
Indicates whether horizontal grid lines are visible or not.
|
boolean |
isHorizontalGridLinesVisible()
Indicates whether horizontal grid lines are visible.
|
boolean |
isSmooth()
Returns the value of the
smoothProperty() . |
boolean |
isVerticalGridLinesVisible()
Indicates whether vertical grid lines are visible.
|
protected void |
layoutChartChildren(double top,
double left,
double width,
double height) |
void |
setColorGradient(HeatMapChart.ColorGradient value)
Sets the value of the
colorGradientProperty() . |
void |
setData(HeatMapChart.Data<X,Y> value)
Sets the data.
|
void |
setDataOriginPointLocation(HeatMapChart.DataOriginPointLocation originPointLocation)
Sets the value of the
dataOriginPointLocationProperty() |
void |
setHorizontalGridLinesVisible(boolean value)
Sets the value of the
verticalGridLinesVisibleProperty() . |
void |
setSmooth(boolean value)
Sets the value of the
smoothProperty() . |
void |
setVerticalGridLinesVisible(boolean value)
Sets the value of the
verticalGridLinesVisibleProperty() . |
BooleanProperty |
smoothProperty()
Indicates if the chart should smooth colors between data points or render each data point as a rectangle with
uniform color.
|
BooleanProperty |
verticalGridLinesVisibleProperty()
Indicates whether vertical grid lines are visible or not.
|
animate, animatedProperty, computeMinHeight, computeMinWidth, computePrefHeight, computePrefWidth, getAnimated, getChartChildren, getLegend, getLegendSide, getTitle, getTitleSide, isLegendVisible, layoutChildren, legendProperty, legendSideProperty, legendVisibleProperty, requestChartLayout, setAnimated, setLegend, setLegendSide, setLegendVisible, setTitle, setTitleSide, shouldAnimate, titleProperty, titleSideProperty
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, impl_computeContains, impl_computeGeomBounds, impl_computeLayoutBounds, impl_createPeer, impl_notifyLayoutBoundsChanged, impl_pickNodeLocal, impl_updatePeer, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, layoutInArea, layoutInArea, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setHeight, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, setWidth, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPosition, snapSize, snapSpace, snapToPixelProperty, widthProperty
getBaselineOffset, getChildren, getChildrenUnmodifiable, getImpl_traversalEngine, getManagedChildren, getStylesheets, impl_getAllParentStylesheets, impl_processCSS, impl_processMXNode, impl_traversalEngineProperty, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setImpl_traversalEngine, setNeedsLayout, updateBounds
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, containsBounds, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getContentBias, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, hasProperties, hoverProperty, idProperty, impl_clearDirty, impl_computeIntersects, impl_cssGetCursorInitialValue, impl_cssGetFocusTraversableInitialValue, impl_findStyles, impl_geomChanged, impl_getLeafTransform, impl_getMatchingStyles, impl_getPeer, impl_getPivotX, impl_getPivotY, impl_getPivotZ, impl_getStyleMap, impl_hasTransforms, impl_intersects, impl_intersectsBounds, impl_isDirty, impl_isDirtyEmpty, impl_isShowMnemonics, impl_isTreeVisible, impl_layoutBoundsChanged, impl_markDirty, impl_pickNode, impl_processCSS, impl_reapplyCSS, impl_setShowMnemonics, impl_setStyleMap, impl_showMnemonicsProperty, impl_syncPeer, impl_transformsChanged, impl_traverse, impl_treeVisibleProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setDisabled, setEffect, setEventDispatcher, setEventHandler, setFocused, setFocusTraversable, setHover, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setPressed, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, visibleProperty
public final BooleanProperty verticalGridLinesVisibleProperty
public final BooleanProperty horizontalGridLinesVisibleProperty
public BooleanProperty smoothProperty
By default smoothing is disabled.
isSmooth()
,
setSmooth(boolean)
public ObjectProperty<HeatMapChart.DataOriginPointLocation> dataOriginPointLocationProperty
HeatMapChart.DataOriginPointLocation
. By default the origin point is located at
HeatMapChart.DataOriginPointLocation.TOP_LEFT
.public ObjectProperty<HeatMapChart.ColorGradient> colorGradientProperty
public final ObjectProperty<HeatMapChart.Data<X,Y>> dataProperty
getData()
,
setData(Data)
public Bounds getPlotAreaBoundsInLocal()
public Bounds getPlotAreaBoundsInParent()
public NumericAxis getZAxis()
Data Z values
. The axis is used to
determine Z value range and render legend
.
By default auto-ranging
is on so that axis
lower
and upper
bounds are updated
by the chart according to the data
min and max value.
The user can fix the range by setting the auto-ranging
to
false
and specifying the lower and upper bound.
public final BooleanProperty verticalGridLinesVisibleProperty()
public final boolean isVerticalGridLinesVisible()
true
if vertical grid lines are visible else false
.public final void setVerticalGridLinesVisible(boolean value)
verticalGridLinesVisibleProperty()
.value
- true
to make vertical lines visiblepublic final BooleanProperty horizontalGridLinesVisibleProperty()
public final boolean isHorizontalGridLinesVisible()
true
if horizontal grid lines are visible else false
.public final void setHorizontalGridLinesVisible(boolean value)
verticalGridLinesVisibleProperty()
.value
- true
to make vertical lines visiblepublic BooleanProperty smoothProperty()
By default smoothing is disabled.
isSmooth()
,
setSmooth(boolean)
public boolean isSmooth()
smoothProperty()
.true
if the smoothing should be applied, false
otherwisepublic void setSmooth(boolean value)
smoothProperty()
.value
- true
to enable smoothingpublic ObjectProperty<HeatMapChart.DataOriginPointLocation> dataOriginPointLocationProperty()
HeatMapChart.DataOriginPointLocation
. By default the origin point is located at
HeatMapChart.DataOriginPointLocation.TOP_LEFT
.public HeatMapChart.DataOriginPointLocation getDataOriginPoint()
dataOriginPointLocationProperty()
public void setDataOriginPointLocation(HeatMapChart.DataOriginPointLocation originPointLocation)
dataOriginPointLocationProperty()
originPointLocation
- new location of the chart's origin pointpublic ObjectProperty<HeatMapChart.ColorGradient> colorGradientProperty()
public void setColorGradient(HeatMapChart.ColorGradient value)
colorGradientProperty()
.value
- the gradient to be usedpublic HeatMapChart.ColorGradient getColorGradient()
colorGradientProperty()
.protected void layoutChartChildren(double top, double left, double width, double height)
layoutChartChildren
in class Chart
public final ObjectProperty<HeatMapChart.Data<X,Y>> dataProperty()
getData()
,
setData(Data)
public final HeatMapChart.Data<X,Y> getData()
dataProperty()
.public final void setData(HeatMapChart.Data<X,Y> value)
value
- the data to be renderedpublic static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
getCssMetaData
in interface Styleable
getCssMetaData
in class Chart
Copyright © 2019 CERN. All rights reserved.