Project

General

Profile

Bug #2904

defalut Axis label format

Added by Стойчо Стефанов Stoycho Stefanov over 8 years ago. Updated about 8 years ago.

Status:
Feedback
Priority:
Normal
Assignee:
Target version:
Start date:
04/04/2014
Due date:
% Done:

0%

Estimated time:

Description

Hi,

it seems to me the default label format in wt-3.3.2 to be an empty string (as it was in wt-3.3.1), but the labels are missing if the scale is date(time). For a numeric axis the rounding of the label number fails (see attached pictures).

void Wt::Chart::WAxis::setLabelFormat (const WString &format)       

The default value is "%.4g" for a numeric axis, and a suitable format for date(time) scales based on a heuristic taking into account the current axis range.

regards,

stoycho


Files

axisLabel.png (28.7 KB) axisLabel.png axis labels Стойчо Стефанов Stoycho Stefanov, 04/04/2014 05:05 PM
#1

Updated by Koen Deforche over 8 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche

Hey,

This is all without calling WAxis::setLabelFormat() ?

Regards,

koen

#2

Updated by Стойчо Стефанов Stoycho Stefanov over 8 years ago

Hey Koen,

yes, I do not call WAxis::setLabelFormat() as I did with wt 3.3.1.

regards,

stoycho

#3

Updated by Стойчо Стефанов Stoycho Stefanov over 8 years ago

yes, I do not call WAxis::setLabelFormat() (neither I did with wt 3.3.1)

#4

Updated by Стойчо Стефанов Stoycho Stefanov over 8 years ago

Hey,

it could be a hint to you. I had similar problem with rounding when a double form a WStandardItem is rendered in an abstract view widget (e.g., WTreeView). I saw that the boost::lecixal_cast does not convert a double into a std::string correctly. I always get the a string like "3.300000000001" from a double 3.3.

My work around was to print the double into an std::stringstream and to assign the stream's string to the WStandartItem.

regards,

stoycho

#5

Updated by Koen Deforche over 8 years ago

  • Status changed from InProgress to Feedback

Hey,

There's a subtle difference between 3.3.1 and 3.3.2 here that may the culprit. In 3.3.1 the default format was an empty string, causing the format to be chosen based on heuristics.

In 3.3.2, the default format is no longer an empty string (and that's also no longer stated as such in he documentation), but the default format still keeps the same behavior. Setting an empty string as format will cause the axis's labels to be formatted by the user's locale. If you were thus calling setLabelFormat("") in 3.3.1 then you would see the behavior you are now seeing (I could reproduce it only by setting an empty string as label format).

The 3.3.2 situation is still not satisfying, which is why there is now a new issue (#2804) to research a definite solution for localization support in Wt.

Regards,

koen

#6

Updated by Koen Deforche about 8 years ago

  • Target version changed from 3.3.3 to 3.3.4

Also available in: Atom PDF