QCustomPlot Discussion and Comments

Feature Request for new Axis Lable TypeReturn to overview

Dear DerManu,

could you please append a custom Axis Lable Type. This may be very helpful in situations where the user will not handle the tick labels manually and think about tick steps, zoom level and so on, but need a custom formatting of the double values. I my case I need a format with thousands separator and with currency.
This may also helpful in situations like http://www.qcustomplot.com/index.php/support/forum/161 where the timezone is different.

e.g. add in the QCPAxis::setupTickVectors() some lines like this to emit a signal containing the reference of the labels QString and the requested double value.

if (mTickLabelType == ltCustom)
  for (int i=mLowestVisibleTick; i<=mHighestVisibleTick; ++i)
    emit CustomTickLabel(&mTickVectorLabels[i], mTickVector.at(i));

The user must only implement its own slot-Function to convert the double Value to a String and QCustomPlot handle which values are needed.

What do you think about this idea?

Hi Weke,

Yep something of that kind is planned. At the moment one can specify the tick vector dynamically and let QCustomPlot generate the labels (just setAutoTicks to false but leave setAutoTickLabels true). As soon as new ticks are needed, the ticksRequest signal is emitted. I'm planning to also offer the inverse, where one can leave autoTicks true but auto tick labels false, and react to a tickLabelsRequest.

Dear DerManu,

thats exact the way I use it at the moment, but to get a custom formating of the labels it is a very hard way.
I'm happy that you plan a custom formating option, many thanks for your great work and i hope you will go on!