QCustomPlot Discussion and Comments

Is Gantt-Chart supported ?Return to overview

I want to draw some chart by timeline, for example , displaying the function-time-cost in a program.
as :
|
| [function -a [function-b] [function-c] [function-b] .... ]
|
|___________________________timeline______________________________________________

You can somewhat emulate gantt charts by using QCPBars with the horizontal axis as value axis and the vertical axis as key axis. Then either explicitly place them via QCPBars::setBaseValue, or stack them on top of each other using QCPBars::moveAbove. (where "above" in this case means in the positive direction of the value axis, so the right.)

You can also draw arrows using QCPItemArrow.

However, there is no explicit Gantt plottable which would make this a bit more convenient.

If anyone would ever be interested - I've developed the QCPGantt extension based on the QCPBars implementation, which is intended to support Gantt charts inside of the qcustomplot library:

https://github.com/svlad-90/DLT-Message-Analyzer/blob/master/dltmessageanalyzerplugin/src/components/plotView/src/QCPGantt.hpp

https://github.com/svlad-90/DLT-Message-Analyzer/blob/master/dltmessageanalyzerplugin/src/components/plotView/src/QCPGantt.cpp

The result looks like this:

https://raw.githubusercontent.com/svlad-90/DLT-Message-Analyzer/master/md/plot_view/gantt_chart_example.png

Feel free to reuse it if it fits your needs. ))