- java.lang.Object
-
- javafx.scene.Node
-
- javafx.scene.Parent
-
- javafx.scene.layout.Region
-
- javafx.scene.chart.Chart
-
- javafx.scene.chart.PieChart
-
- All Implemented Interfaces:
-
Styleable
,EventTarget
public class PieChart extends Chart
显示PieChart。 图表内容由基于PieChart上设置的数据的饼图填充。顺时针属性默认设置为true,这意味着切片以顺时针顺序放置。 labelsVisible属性用于显示饼图切片标签。
- 从以下版本开始:
- JavaFX 2.0
-
-
Property Summary
Properties Type Property 描述 BooleanProperty
clockwise
如果真的,我们从startAngle开始顺时针放置切片ObjectProperty<ObservableList<PieChart.Data>>
data
PieCharts数据DoubleProperty
labelLineLength
从饼图的外部到切片标签的线的长度。BooleanProperty
labelsVisible
当绘制真实的饼图切片标签时DoubleProperty
startAngle
开始第一个饼切片的角度-
Properties inherited from class javafx.scene.chart.Chart
animated, legend, legendSide, legendVisible, title, titleSide
-
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Properties inherited from class javafx.scene.Parent
needsLayout
-
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
-
-
Nested Class Summary
Nested Classes Modifier and Type Class 描述 static class
PieChart.Data
PieChart数据项,表示PieChart中的一个切片
-
Field Summary
-
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
-
-
构造方法摘要
构造方法 Constructor 描述 PieChart()
构造一个新的空的PieChart。PieChart(ObservableList<PieChart.Data> data)
用给定的数据构建一个新的PieChart
-
方法摘要
所有方法 静态方法 接口方法 具体的方法 Modifier and Type 方法 描述 BooleanProperty
clockwiseProperty()
如果真的,我们从startAngle开始顺时针放置切片ObjectProperty<ObservableList<PieChart.Data>>
dataProperty()
PieCharts数据static List<CssMetaData<? extends Styleable,?>>
getClassCssMetaData()
List<CssMetaData<? extends Styleable,?>>
getCssMetaData()
该方法应该委托给Node.getClassCssMetaData()
,以便可以访问Node的CssMetaData而不需要反射。ObservableList<PieChart.Data>
getData()
获取属性数据的值。double
getLabelLineLength()
获取属性labelLineLength的值。boolean
getLabelsVisible()
指示是否绘制饼切片标签double
getStartAngle()
获取属性startAngle的值。boolean
isClockwise()
顺时针方向获取属性值。DoubleProperty
labelLineLengthProperty()
从饼图的外部到切片标签的线的长度。BooleanProperty
labelsVisibleProperty()
当绘制真实的饼图切片标签时protected void
layoutChartChildren(double top, double left, double contentWidth, double contentHeight)
调用更新和布局从getChartChildren()void
setClockwise(boolean value)
顺时针设置属性的值。void
setData(ObservableList<PieChart.Data> value)
设置属性数据的值。void
setLabelLineLength(double value)
设置属性labelLineLength的值。void
setLabelsVisible(boolean value)
设置属性labelsVisible的值。void
setStartAngle(double value)
设置属性startAngle的值。DoubleProperty
startAngleProperty()
开始第一个饼切片的角度-
Methods inherited from class javafx.scene.chart.Chart
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
-
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, 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, getInitialCursor, getInitialFocusTraversable, 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, getViewOrder, hasProperties, hoverProperty, idProperty, 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, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildren, getChildrenUnmodifiable, getManagedChildren, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout, requestParentLayout, setNeedsLayout, updateBounds
-
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, computeMaxHeight, computeMaxWidth, getBackground, getBorder, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, 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, snapPositionX, snapPositionY, snapSize, snapSizeX, snapSizeY, snapSpace, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
-
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
-
-
-
Property Detail
-
data
public final ObjectProperty<ObservableList<PieChart.Data>> dataProperty
PieCharts数据- 另请参见:
-
getData()
,setData(ObservableList)
-
startAngle
public final DoubleProperty startAngleProperty
开始第一个饼切片的角度- 另请参见:
-
getStartAngle()
,setStartAngle(double)
-
clockwise
public final BooleanProperty clockwiseProperty
如果真的,我们从startAngle开始顺时针放置切片- 另请参见:
-
isClockwise()
,setClockwise(boolean)
-
labelLineLength
public final DoubleProperty labelLineLengthProperty
从饼图的外部到切片标签的线的长度。
-
labelsVisible
public final BooleanProperty labelsVisibleProperty
当绘制真实的饼图切片标签时
-
-
构造方法详细信息
-
PieChart
public PieChart()
构造一个新的空的PieChart。
-
PieChart
public PieChart(ObservableList<PieChart.Data> data)
用给定的数据构建一个新的PieChart- 参数
-
data
- 要使用的数据,这是使用的实际列表,所以对其进行的任何更改将反映在图表中
-
-
方法详细信息
-
getData
public final ObservableList<PieChart.Data> getData()
获取属性数据的值。- Property description:
- PieCharts数据
-
setData
public final void setData(ObservableList<PieChart.Data> value)
设置属性数据的值。- Property description:
- PieCharts数据
-
dataProperty
public final ObjectProperty<ObservableList<PieChart.Data>> dataProperty()
PieCharts数据- 另请参见:
-
getData()
,setData(ObservableList)
-
getStartAngle
public final double getStartAngle()
获取属性startAngle的值。- Property description:
- 开始第一个饼切片的角度
-
setStartAngle
public final void setStartAngle(double value)
设置属性startAngle的值。- Property description:
- 开始第一个饼切片的角度
-
startAngleProperty
public final DoubleProperty startAngleProperty()
开始第一个饼切片的角度- 另请参见:
-
getStartAngle()
,setStartAngle(double)
-
setClockwise
public final void setClockwise(boolean value)
顺时针设置属性的值。- Property description:
- 如果真的,我们从startAngle开始顺时针放置切片
-
isClockwise
public final boolean isClockwise()
顺时针方向获取属性值。- Property description:
- 如果真的,我们从startAngle开始顺时针放置切片
-
clockwiseProperty
public final BooleanProperty clockwiseProperty()
如果真的,我们从startAngle开始顺时针放置切片- 另请参见:
-
isClockwise()
,setClockwise(boolean)
-
getLabelLineLength
public final double getLabelLineLength()
获取属性labelLineLength的值。- Property description:
- 从饼图的外部到切片标签的线的长度。
-
setLabelLineLength
public final void setLabelLineLength(double value)
设置属性labelLineLength的值。- Property description:
- 从饼图的外部到切片标签的线的长度。
-
labelLineLengthProperty
public final DoubleProperty labelLineLengthProperty()
从饼图的外部到切片标签的线的长度。
-
setLabelsVisible
public final void setLabelsVisible(boolean value)
设置属性labelsVisible的值。- Property description:
- 当绘制真实的饼图切片标签时
-
getLabelsVisible
public final boolean getLabelsVisible()
指示是否绘制饼切片标签- 结果
- 如果饼图切片标签可见,则为true,否则为false。
-
labelsVisibleProperty
public final BooleanProperty labelsVisibleProperty()
当绘制真实的饼图切片标签时
-
layoutChartChildren
protected void layoutChartChildren(double top, double left, double contentWidth, double contentHeight)
调用更新和布局从getChartChildren()- Specified by:
-
layoutChartChildren
在Chart
- 参数
-
top
- 从原始位置的顶部偏移量计入图表内容上的任何填充 -
left
- 从原始位置左偏移到图表内容上的任何填充 -
contentWidth
- 布局图表的区域的宽度 -
contentHeight
- 将图表布置的区域的高度
-
getClassCssMetaData
public static List<CssMetaData<? extends Styleable,?>> getClassCssMetaData()
- 结果
- 与此类相关联的CssMetaData可能包括其类的CssMetaData。
- 从以下版本开始:
- JavaFX 8.0
-
getCssMetaData
public List<CssMetaData<? extends Styleable,?>> getCssMetaData()
该方法应该委托给Node.getClassCssMetaData()
,以便可以访问Node的CssMetaData而不需要反射。- Specified by:
-
getCssMetaData
在接口Styleable
- 重写:
-
getCssMetaData
在Chart
- 结果
- 与该节点相关联的CssMetaData,其可以包括其超类的CssMetaData。
- 从以下版本开始:
- JavaFX 8.0
-
-