Bug #2904
opendefalut Axis label format
0%
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
Updated by Koen Deforche over 10 years ago
- Status changed from New to InProgress
- Assignee set to Koen Deforche
Hey,
This is all without calling WAxis::setLabelFormat() ?
Regards,
koen
Updated by Стойчо Стефанов Stoycho Stefanov over 10 years ago
Hey Koen,
yes, I do not call WAxis::setLabelFormat() as I did with wt 3.3.1.
regards,
stoycho
Updated by Стойчо Стефанов Stoycho Stefanov over 10 years ago
yes, I do not call WAxis::setLabelFormat() (neither I did with wt 3.3.1)
Updated by Стойчо Стефанов Stoycho Stefanov over 10 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
Updated by Koen Deforche over 10 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
Updated by Koen Deforche over 10 years ago
- Target version changed from 3.3.3 to 3.3.4