LaminateFloor
20th October 2014, 14:40
I'm trying to figure out how to support both zero based time and a time offset on the x-axis scale.
The program I'm developing have the option to choose between zero based time where the samples begins at time 00:00 and the clock time where the samples were recorded. The samples are saved as zero based time in the memory. I've managed to inherit the QwtDateScaleDraw so that the when the clock time is used, it shows the text label with the clock time based offset. Everything works fine with this unless you would want an alignment of the clock time based values. So if the graph begins at 23:12:47.250 I don't want the tick of the left most value to be that but aligned to the next appropriate time, 23:12:45 for example. QwtDateScaleEngine already supports this but the zero based time is propagated to the scale even if the text label is different.
The question here is how to best support dual times with both proper text and scale alignment and how to inject the false x-values with the clock time based offset while the plot still believes that it is zero based?
BTW, I cannot change the x-axis values as I have other widgets based on this scale. Then I would have go through all of them too.
The program I'm developing have the option to choose between zero based time where the samples begins at time 00:00 and the clock time where the samples were recorded. The samples are saved as zero based time in the memory. I've managed to inherit the QwtDateScaleDraw so that the when the clock time is used, it shows the text label with the clock time based offset. Everything works fine with this unless you would want an alignment of the clock time based values. So if the graph begins at 23:12:47.250 I don't want the tick of the left most value to be that but aligned to the next appropriate time, 23:12:45 for example. QwtDateScaleEngine already supports this but the zero based time is propagated to the scale even if the text label is different.
The question here is how to best support dual times with both proper text and scale alignment and how to inject the false x-values with the clock time based offset while the plot still believes that it is zero based?
BTW, I cannot change the x-axis values as I have other widgets based on this scale. Then I would have go through all of them too.