View Full Version : Stopping the tick mark value changing exponent

2nd October 2008, 16:04
Hi again,
Is it possible to stop the tick mark values changing from 998,999 to 1.0? Since there is no exponent label on the graph, to the user it looks like its going from 999 back to 1.

See the image for an image of what I mean.

Thanks again,

2nd October 2008, 17:08
Mapping the tick values int labels is done by QwtAbstractScaleDraw::label():

QwtText QwtAbstractScaleDraw::label(double value) const
return QLocale::system().toString(value);

Overload it if you want something different.


21st October 2008, 20:20

I think what you are seeing is a locale problem. The tick marks aren't going from 999 to 1, they are going from 999 to 1000. Somehow, your locale is set to use a "." (period) instead of a "," (comma) to indicate the thousands position.

As Uwe said, if you don't want the thousands delimiter, you need to override the label() method in your own QwtScaleDraw-derived class.