BoxPlotSeries QML Type

以盒须图显示数据。更多

Import Statement: import QtCharts 2.9
In C++: QBoxPlotSeries
Inherits:

AbstractSeries

属性

信号

方法

  • append(BoxSet box)
  • append(string label, VariantList values)
  • at(int index)
  • clear()
  • insert(int index, string label, VariantList values)
  • remove(QBoxSet boxset)

详细说明

箱形图系列是箱形须项的容器。多个系列中的项目会根据其索引值分组。

BarCategoryAxis 类用于将类别添加到图表的坐标轴上。类别标签必须是唯一的。如果为多个方框-须项目定义了相同的类别标签,则只绘制第一个类别标签。

下面的 QML 代码片段展示了如何创建一个简单的框-须图表:

import QtQuick 2.0
import QtCharts 2.0

ChartView {
    title: "Box Plot series"
    width: 400
    height: 300
    theme: ChartView.ChartThemeBrownSand
    legend.alignment: Qt.AlignBottom

    BoxPlotSeries {
        id: plotSeries
        name: "Income"
        BoxSet { label: "Jan"; values: [3, 4, 5.1, 6.2, 8.5] }
        BoxSet { label: "Feb"; values: [5, 6, 7.5, 8.6, 11.8] }
        BoxSet { label: "Mar"; values: [3.2, 5, 5.7, 8, 9.2] }
        BoxSet { label: "Apr"; values: [3.8, 5, 6.4, 7, 8] }
        BoxSet { label: "May"; values: [4, 5, 5.2, 6, 7] }
    }
}


另请参阅 BoxSetBarCategoryAxis

属性文档

axisX : AbstractAxis

用于系列的 X 轴。如果 axisX 和axisXTop 都未定义,则会为系列创建一个BarCategoryAxis

另请参阅 axisXTop


axisXTop : AbstractAxis

用于系列的 x 轴,绘制在图表视图的顶部。

注意: 只能提供axisX 或 axisXTop,不能同时提供。

另请参阅 axisXaxisX


axisY : AbstractAxis

用于系列的 Y 轴。如果不定义 axisY 和axisYRight ,则会为系列创建ValueAxis

另请参阅 axisYRight


axisYRight : AbstractAxis

用于系列的 Y 轴,在图表视图中绘制在右侧。

注意: 只能提供axisY 或 axisYRight,不能同时提供。

另请参阅 axisY


boxOutlineVisible : bool

方框轮廓的可见度。


boxWidth : real

框和须项的宽度。该值表示项目在其类别中的相对宽度。该值介于 0.0 和 1.0 之间。负值用 0.0 代替,大于 1.0 的值用 1.0 代替。


brushFilename : string

用作系列刷子的文件名。


count : int [read-only]

方框图系列中的方框-须项数量。


信号文档

boxsetsAdded(list sets)

sets 指定的方框-须项被添加到系列中时,将发出该信号。

相应的信号处理程序是onBoxsetsAdded()

注: 相应的处理程序是onBoxsetsAdded


boxsetsRemoved(list sets)

sets 指定的方框和胡须项目从系列中删除时,将发出此信号。

相应的信号处理程序是onBoxsetsRemoved()

注: 相应的处理程序是onBoxsetsRemoved


clicked(BoxSet boxset)

当用户在图表中点击boxset 指定的方框和胡须项时,将发出该信号。

相应的信号处理程序是onClicked()

注: 相应的处理程序是onClicked


doubleClicked(BoxSet boxset)

当用户双击图表中由boxset 指定的方框和胡须项目时,将发出该信号。

相应的信号处理程序是onDoubleClicked()

注: 相应的处理程序是onDoubleClicked


hovered(bool status, BoxSet boxset)

当鼠标悬停在图表中boxset 所指定的方框和胡须项上时,将发出该信号。当鼠标移到该项目上时,status 变成true ,当鼠标再次移开时,变成false

相应的信号处理程序是onHovered()

注: 相应的处理程序是onHovered


pressed(BoxSet boxset)

当用户按下图表上的boxset 时,会发出该信号。

相应的信号处理程序是onPressed

注: 相应的处理程序是onPressed


released(BoxSet boxset)

当用户释放鼠标按下图表中boxset 指定的方括号项目时,将发出该信号。

相应的信号处理程序是onReleased()

注: 相应的处理程序是onReleased


方法文档

append(BoxSet box)

box 指定的方框加须项添加到系列中。


append(string label, VariantList values)

label 指定的标签和values 指定的值作为新的方框和胡须项添加到系列中。


at(int index)

index 指定的位置返回盒须项。


clear()

删除系列中的所有盒须条目并永久删除。


insert(int index, string label, VariantList values)

index 指定的位置向系列中插入一个新的方括号项目,其标签由label 指定,值由values 指定。


remove(QBoxSet boxset)

从系列中删除boxset 指定的方框和胡须项。


© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.