iwbnwif / wxFreeChart

This is a clone (not fork) of the pbfordev/wxFreeChart repository. It has their original fixes to the the wxCode version.
Other
37 stars 21 forks source link

Alternative way for determining values on a label axis #2

Closed iwbnwif closed 7 years ago

iwbnwif commented 8 years ago

From @iwbnwif on April 17, 2016 11:12

Currently the values that are shown on a LabelAxis, at least on a NumberAxis, are determined by the range of the bounds (i.e. max bound - min bound) and the SetLabelCount() method.

The result is that the values displayed, whilst correct, are not particularly intuitive.

For example, in XY Demo 1, the bounds for the vertical axis are automatically derived as 4.0 and 34.0. This is okay, but because the default SetLabelCount is used (which seems to be 5) then the labels are numbered 4.0, 11.5, 19.0, 26.5 and 34.0.

It would be much more intuitive in this situation to have labels at 0, 10, 20, 30 and 40.

So rather than the current SetLabelCount(), I think it would be better to have a SetLabelInterval() method - at least as an alternative way of controlling label values.

Changing this would also require a modification to the automatic scaling algorithm so that the max and min bounds fall on a set interval.

Copied from original issue: pbfordev/wxFreeChart#3

iwbnwif commented 7 years ago

Superseded by #7, although a SetLabelInterval() method might still be useful.