03 Jan 2017 21:01
ChartView: Make LabelInterval adjust correctly when MajorTickInterval is adjusted
When setting MajorTickInterval, the actual interval used in display is adjusted when zooming to show a reasonable number of ticks. However, if LabelInterval is used along with it to achieve the desired number of labels on the chart, LabelInterval is not adjusted along with MajorTickInterval, resulting in too many or too few labels being displayed. Moreover the automatic adjustment of MajorTickInterval cannot be disabled, leading to problematic label display that cannot easily be handled by the developer without inside knowledge of the algorithm.
Nice features would be:
- Adjust LabelInterval along with MajorTickInterval to keep approximately the same number of labels on the chart.
- Given the above, add an option to allow the Chart to determine the optimal MajorTickInterval and LabelInterval by itself (currently if MajorTickInterval is not specified, it displays ALL category ticks which can be way too many for the display)
- Add an option to disable the MajorTickInterval automatic adjustment if the programmer wishes to handle this manually
This suggestion arose out of this forum thread, which includes an example demonstrating the issue: