BoxPlotSeries QML model in C++
Solved
QML and Qt Quick
-
Hello,
Looking into Qt Documentation of BoxPlotSeries I see just at the beginning:
Instantiates: QBoxPlotSeries
So, if I want to feed that QBoxPlotSeries with data, how can I access it from C++?
ChartView { id: boxPlotView BoxPlotSeries{ id: boxPlotSeries } }
-
You would expose your data as a C++ table model and use it with
VBoxPlotModelMapper
:ChartView { id: boxPlotView BoxPlotSeries{ VBoxPlotModelMapper { model: myCustomModel // QAbstractItemModel derived implementation firstBoxSetColumn: 0 lastBoxSetColumn: 3 } } }
-
Does anyone know how to set labels for
BoxPlotSeries
usingVBoxPlotModelMapper
? In the documentation the following is written:Each box-and-whiskers item contains data starting from row 1. The name of an item is defined by the column header.
However, it is unclear to me what "column header" refers to in this context. I attempted to implement the
headerData
method, but it wasn't called. Any insights would be appreciated!