Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#11631 closed defect (fixed)

chart label shortening feature

Reported by: JayZ(zhouxiang) Owned by: Eugene Lazutkin
Priority: high Milestone: 1.6
Component: Charting Version: 1.5
Keywords: Cc: xiangxz@…
Blocked By: Blocking:

Description

Long label always cause the x axis tick labels intersected with each other, this patch will do label shortening work with two provided parameters: 1> maxLabelWordCount: set the max word(character) count for each label 2> maxLabelSize: set the max length in pixel for each label the truncated label will end with "..." and there will be a tooltip which will show the whole label text when you hover on the label

This patch also separated an independent tooltip(dojox.charting.MasterTooltip?) from the "dojox.charting.action2d.Tooltip", so as to use the tooltip anywhere

Attachments (2)

chart_labelshortening.png (4.1 KB) - added by JayZ(zhouxiang) 9 years ago.
snapshot of label shortening feature
label_shortening.patch (32.8 KB) - added by Adam Peller 9 years ago.
update from xiang zhou (IBM, CCLA): Add customize trailing symbols and rename the "maxLabelWordCount" to "maxLabelCharCount", there will be a tooltip when you hover on the truncated labels. About "add a general way to provide already abbreviated tick labels", seems there is no rule to follow, even the month of the year: "Sep" for "September", the day of the week: "Mon" for "Monday", user can also abbreviate "September" to "Sept", "Monday" to "MD". I suppose it's better to let user customize it in "labelFunc".

Download all attachments as: .zip

Change History (4)

Changed 9 years ago by JayZ(zhouxiang)

Attachment: chart_labelshortening.png added

snapshot of label shortening feature

Changed 9 years ago by Adam Peller

Attachment: label_shortening.patch added

update from xiang zhou (IBM, CCLA): Add customize trailing symbols and rename the "maxLabelWordCount" to "maxLabelCharCount", there will be a tooltip when you hover on the truncated labels. About "add a general way to provide already abbreviated tick labels", seems there is no rule to follow, even the month of the year: "Sep" for "September", the day of the week: "Mon" for "Monday", user can also abbreviate "September" to "Sept", "Monday" to "MD". I suppose it's better to let user customize it in "labelFunc".

comment:1 Changed 8 years ago by Eugene Lazutkin

Resolution: fixed
Status: newclosed

(In [23512]) Charting: abbreviated labels, thx Xiang Zhou (CCLA, IBM)!, !strict, fixes #11631, fixes #11843.

comment:2 Changed 8 years ago by Eugene Lazutkin

(In [23514]) Charting: switched tooltip tests to Claro theme, !strict, refs #11686, refs #11631.

Note: See TracTickets for help on using tickets.