Plotting using Qwt with time values in the x-axis
-
Hi,
I have two QVectors where the y-axis has double values, but the x-axis has time values which are specified in HH::MM::SS.xxxxx, where xxxxx is in milliseconds.
QVector<QString> timeData; //x-axis
QVector<double> attributeData; //y-axisTo setup a plot I have the following:
QwtPlotCurve *curve1 = new QwtPlotCurve( "Curve 1" );When assigning setSamples since time is not a double value, any ideas on how to plot by time on the x axis? Of course qwt needs to be able to interpret the time so it can move along the x-axis properly. There must be a way to do it, just kind find any info on it.
curve1->setSamples(timeData, y-data); //time data is not a double what else can I use?Thanks in advance!
-
As I remember, you need to set the 'date-time' axis class on the X-asis, or to create an own axis-class and then set to X-axis. Please read the Qwt documentation at first. Also you can ask this question on the qtcentre forum, where the author himself answering the questions.