Legend QML Type
Legend is part of Qt Chart QML API. More...
Import Statement: | import QtCharts 2.1 |
Instantiates: | QLegend |
Properties
- alignment : Qt.Alignment
- backgroundVisible : bool
- borderColor : color
- color : color
- font : Font
- labelColor : color
- reverseMarkers : bool
- showToolTips : bool
- visible : bool
Detailed Description
Legend is a graphical object, which displays legend of the chart. Legend state is updated by ChartView, when series have been changed. Legend is used via ChartView class. For example:
ChartView { legend.visible: true legend.alignment: Qt.AlignBottom // Add a few series... }
Please note that there is no QML API available for modifying legend markers, unlike in the Qt API of Charts. The use case of modifying markers can be implemented for example by creating your own custom legend. For an example on how to do this, see Qml Custom Example application.
Property Documentation
alignment : Qt.Alignment |
The alignment of the legend.
Legend paints on the defined position in the chart. The following alignments are supported: Qt.AlignTop, Qt.AlignBottom, Qt.AlignLeft, Qt.AlignRight. If you set more than one flag the result is undefined.
Whether reverse order is used for the markers in legend or not. False by default.
Whether tooltips are shown when the text is truncated. This is false by default. This currently has no effect as there is no support for tooltips in QML.
Whether the legend is visible or not.
By default, this property is true
.
See also QGraphicsObject::visible.