顯示圖錶的圖例。 更多...
| import 語句: | import QtCharts 2.2 |
| 實例化: | 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, as illustrated by Qml Custom Example .
|
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.
Whether the legend background is visible.
The line color of the legend.
The background (brush) color of the legend.
The font of the markers used by the legend.
The color of the brush used to draw labels.
The default shape of the legend markers. The default value is
MarkerShapeRectangle
.
| 常量 | 描述 |
|---|---|
Legend.MarkerShapeRectangle
|
Legend markers are rectangular |
Legend.MarkerShapeCircle
|
Legend markers are circular |
Legend.MarkerShapeFromSeries
|
Legend marker shape is determined by the series |
This QML property was introduced in Qt 5.9.
另請參閱 QLegend::MarkerShape .
Whether reverse order is used for the markers in the legend. This property is
false
在默認情況下。
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.
Whether the legend is visible.
默認情況下,此特性為
true
.
另請參閱 QGraphicsObject::visible .