Formatting axisX of box plot as date time type
-
wrote on 18 Oct 2016, 05:12 last edited by
followed the example http://doc.qt.io/qt-5/qtcharts-boxplotchart-example.html, to generate box plot and trying to figure out how to add date time axisX.
-
wrote on 18 Oct 2016, 18:21 last edited by
you can use http://doc.qt.io/qt-5/qdatetimeaxis.html
QDateTimeAxis *axisX = new QDateTimeAxis; axisX->setFormat("dd-MM-yyyy"); chart->setAxisX(axisX, boxWhiskSeries);
-
wrote on 19 Oct 2016, 00:16 last edited by vorlket
Yep. How do you append x axis values to the QBoxSet / QBoxPlotSeries though? I don't see it in the example (http://doc.qt.io/qt-5/qtcharts-boxplotchart-example.html). I should retitle the question as adding and formatting.
-
wrote on 19 Oct 2016, 06:41 last edited by
It seems I have to use QBarCategoryAxis, which doesn't have setFormat method. The underlying data is box and whiskers time series, so it's a bit unnatural to convert datetime value to category string for display. Wonder if there's a better workaround.
1/4