QCustomPlot Discussion and Comments

how to achieve constant Tickcount?Return to overview

hi, i want to use Time ticker(QCPAxisTickerTime) in my plot's xAxis. it works good with this code:

    QSharedPointer<QCPAxisTickerTime> timeTicker(new QCPAxisTickerTime);
    ui->plot_platform->xAxis->setTicker(timeTicker);

but in scaling the plot horizontally(on xAxis), i can't have a constant TickCount. for example i want to set 10 Tick label constantly in screen.
(this could be achieved by:
    QSharedPointer<QCPAxisTickerFixed> timeTicker(new QCPAxisTickerFixed);
    timeTicker->setScaleStrategy(QCPAxisTickerFixed::ssNone);
    ui->plot_platform->xAxis->setTicker(timeTicker);

but i need time ticker.
)
what i can to?

call timeTicker->setTickStrategy(tssMeetTickCount)
and then call timeTicker->setTickCount(10).

Be aware that tssMeetTickCount will also not guarantee exactly 10 ticks, but sacrifice more in terms of pretty labels, to get closer to the wanted tick count.

Forcing exactly the number of ticks that you set is a bad idea, since it leads to ridiculously hard to read labels and tick spacing.

//EDIT: wait, if you use fixed ticker with scale strategy "none", then you're not getting a constant tick count. You're getting a constant tick step. Is that what you're looking for?

I am setting the zoom in and zoom back manual. So i set in each zoom-level a specific range and a specific step. So the Constant tick step yields to constant tick cunt and also it is readable.
is there any strategy to achieve constant tick step in timeTicker?