Legend QML 类型

显示图表的图例。 更多...

import 语句: import QtCharts 2.7
实例化: QLegend

特性

详细描述

A legend is a graphical object that displays the legend of a chart. The legend state is updated by the ChartView type when series change. The 图例 type properties can be attached to the ChartView type. For example:

ChartView {
    legend.visible: true
    legend.alignment: Qt.AlignBottom
    // Add a few series...
}
					

注意: There is no QML API available for modifying legend markers. Markers can be modified by creating a custom legend. For more information, see 使用图例标记 .

特性文档编制

alignment : alignment

Defines how the legend is aligned with the chart. Can be Qt.AlignLeft , Qt.AlignRight , Qt.AlignBottom ,或 Qt.AlignTop . If you set more than one flag, the result is undefined.

backgroundVisible : bool

Whether the legend background is visible.

borderColor : color

The line color of the legend.

color : color

The background (brush) color of the legend.

font : Font

The font of the markers used by the legend.

labelColor : color

The color of the brush used to draw labels.

markerShape : enumeration

The default shape of the legend markers. The default value is MarkerShapeRectangle .

常量 描述
Legend.MarkerShapeRectangle Legend markers are rectangular
Legend.MarkerShapeCircle Legend markers are circular
MarkerShapeRotatedRectangle Legend markers are rotated rectangle shaped.
MarkerShapeTriangle Legend markers are triangular.
MarkerShapeStar Legend markers are star shaped.
MarkerShapePentagon Legend markers are pentagon shaped.
Legend.MarkerShapeFromSeries Legend marker shape is determined by the series

另请参阅 QLegend::MarkerShape .

reverseMarkers : bool

Whether reverse order is used for the markers in the legend. This property is false 在默认情况下。

showToolTips : bool

Whether tooltips are shown when the text is truncated. This property is false by default. This property currently has no effect as there is no support for tooltips in QML.

visible : bool

Whether the legend is visible.

默认情况下,此特性为 true .

另请参阅 QGraphicsObject::visible .