I have a data set in an QSqlQueryModel that looks like this
+-----------+-----------+------------+
| date | sent | recv |
|===========+===========+============+
| 2013-4-21 | 3839088 | 140036219 |
| 2013-4-22 | 146037305 | 1439537452 |
| 2013-4-23 | 67140372 | 1787850213 |
| ... |
+-----------+-----------+------------+
Values in the date column are QDateTime objects, values in the sent and recv columns are integers.
I want to display this data in a QML ChartView using the StackedBarSeries and a VBarModelMapper:
ChartView {
anchors.fill: parent
antialiasing: true
StackedBarSeries {
VBarModelMapper {
model: SqlTrafficModel {}
firstBarSetColumn: 1
lastBarSetColumn: 2
firstRow: 0
}
}
}
This is the current state of my view
My problem is that the StackedBarSeries just uses an index for the x-axis label, however I'd like to display the date of each bar as it's x-axis label.
I tried to use DateTimeAxis for the axisX property but it looks like it just shifts the x-axis to the provided min and max values while interpreting the original labels as unix timestamps.