Project

General

Profile

Actions

Bug #2904

open

defalut Axis label format

Added by Стойчо Стефанов Stoycho Stefanov over 10 years ago. Updated over 10 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
Actions #1

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

Actions #2

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

Actions #3

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

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

Actions #4

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

Actions #5

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

Actions #6

Updated by Koen Deforche over 10 years ago

  • Target version changed from 3.3.3 to 3.3.4
Actions

Also available in: Atom PDF