Opened 12 years ago

Closed 12 years ago

#10994 closed defect (fixed)

Chart2D axis labels misaligned when first label is empty string

Reported by: davec Owned by: Eugene Lazutkin
Priority: high Milestone: 1.5
Component: Charting Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:


The function _groupLabelWidth() in the Axis2D default attempts to measure the maximum label width by concatenating the labels together with line breaks between and then measuring the text box width. It detects whether strings or objects have been passed by testing for a "text" field on the first label element. However, if the text for the first label is empty "" this is falsy and the code assumes that the label element objects are actually strings and concatenates them with unusual and unexpected results. The label strings are misaligned in this case, and can readily overwrite the chart area itself.

Attachments (1)

100413-labels.patch (526 bytes) - added by Adam Peller 12 years ago.
patch from Dave Clark (IBM, CCLA)

Download all attachments as: .zip

Change History (3)

comment:1 Changed 12 years ago by Eugene Lazutkin

Milestone: tbd1.5
Status: newassigned

Changed 12 years ago by Adam Peller

Attachment: 100413-labels.patch added

patch from Dave Clark (IBM, CCLA)

comment:2 Changed 12 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [21871]) Fixing false "falsy" check for an object, thx davec!, !strict, fixes #10994.

Note: See TracTickets for help on using tickets.