#13180 closed enhancement (fixed)
dojox.charting axis should support a drop label mode
Reported by: | cjolif | Owned by: | cjolif |
---|---|---|---|
Priority: | high | Milestone: | 1.8 |
Component: | Charting | Version: | 1.6.1 |
Keywords: | Cc: | [email protected]…, cjolif | |
Blocked By: | Blocking: |
Description (last modified by )
When labels are too wide on a small axis, labels are overlapping. The axis should provide an optional parameter to automatically drop labels when they overlap.
In order to keep the axis understandable by the user the drop should occur consistently across the labels. For example either 1 over 2 labels should be dropped or 1 over 3 etc... but not just a single label dropped.
Attachments (2)
Change History (19)
comment:1 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|
comment:2 Changed 10 years ago by
comment:3 Changed 9 years ago by
Owner: | changed from Eugene Lazutkin to cjolif |
---|
comment:4 Changed 9 years ago by
Description: | modified (diff) |
---|
comment:5 Changed 9 years ago by
comment:6 Changed 9 years ago by
Cc: | cjolif added; [email protected]… removed |
---|---|
Description: | modified (diff) |
comment:7 Changed 9 years ago by
The proposed solution is taking into account the drop mechanism that already exists for minor labels.
It means it will be a two steps process:
1/ if the max label width do not fit in minor step, then minor labels are ignored
2/ if minor labels are ignored and the max label width do not fit in a major step then the right amount of major labels are skipped to allow labels not to overlap.
Step 1/ will be enhanced compare to current implementation taken into account for example custom label function that might exist and are not taken into account currently.
Changed 9 years ago by
Attachment: | #13180.patch added |
---|
draft patch, use dropLabels: true in axis to enable the feature (look at the test)
comment:8 Changed 9 years ago by
In the above patch, the computation is done each time the axis scale change. However there are two parts in this computation:
1/ compute the labels max size
2/ use that max size to know how many labels to drop
Phase 1 could be done only once and not re-done at each scale change (provided the fact the axis labels do not change on zooming in/out).
Changed 9 years ago by
Attachment: | #13180.2.patch added |
---|
second draft patch (caching the first label size computation)
comment:11 Changed 9 years ago by
The implemented mechanism works well in most cases. A limitation is when the axis changed its labels sizes when being zoomed (for example if you did not specify steps to your axis it auto-compute them and the change dynamically leading to different numeric labels sizes). In this case you might want to pre-reserve more room for that. Ideally we should deal with that automatically but this would mean recomputing the size of the labels at each zoom action. Might be costly.
besides the drop to occur consistently another important point to care about is that when one will scroll the chart he does not want a different set of labels to be dropped. That means the operation must probably pre-computed on the full extend of the scale not just on the visible part.