Is there an automatic for that?
I have some gauges that in various deployments have various larger scales (1-22 in one case, 1-168in the other).
I found that I either set the LabelInterval in code (which sould mean writing an algo to get a decent number) or it gets totally unprofessional.
Means, on the 128 step gauge, i have steps 16.6, 33.6, 50,4, 67.2, 84, 100.8, 117.6, 124.4 and 151.2
Sensibly, a human would likely go with 20 or 25 as step - there is ZERO sense in showing .x numbers for something that goes from 1 to nearly 170. When did you see an analog speedometer / tacho scale on a car last time that was showing non-integer numbers?
Any automatics for that that overlook or.... is that really so that the poor developer now has to write a helper function to get a sensible LabelInterval?
hey, just checking if you still need any feedback from our side. Thanks,
Angel
hey,
Was Graham's feedback of help to you ? Please let us know if you need any additional help. Thanks
Here's another option that coerces the range to make it divisible by 10, so you always wind up with the same number of labels.
http://jsfiddle.net/gmurray/pKcU3/
http://jsfiddle.net/gmurray/RUPR5/
Here's an example of how you can try to calculate an ideal factor that divides your range evenly. Note, that if you select a large prime number, you will end up with an unsatisfactory number of labels.
The gauge (which is still a community preview) forum is located here: http://ko.infragistics.com/community/forums/726.aspx
The gauge favors selecting a certain number of tickmarks rather than attempting to auto calculate an interval that evenly divides the range with a pleasant number of tickmarks (which may not even be possible). If you provide a range that is evenly dividable by 10, then you will get integral labels. Otherwise, you must provide your own interval. Please note that there is both an interval, and a label interval. Interval drives both the tickmarks and labels, and labelInterval is for if you want to drive the interval of the labels separately from the tickmarks (less likely, unless you want to skip every other tickmark, etc.)
Here's an example of setting the interval to make the labels have integer values:
http://jsfiddle.net/gmurray/eABn9/
The gauge, if it were to automatically try to select an interval, may not always be able to do so. Say, for example, you had a range that is a prime number, and an interval of 1 would provide too many tickmarks. In this case, the gauge would prefer to alter the range by shifting the min/max of the scale. Which it not generally something that is desirable.
Are you running into this issue because you are binding dynamic values as the min/max? If its acceptable to coerce the min and max to make them more pleasantly divisible, that can avoid scenarios that would prevent having a pleasant number of integral labels. Say, for example, you shifted the maximum to make the range have 10 as a factor, then you would have much more pleasant labels than simple integers.
If you have a scenario where the gauge could control the interval and the min and max to try to select pleasant labels automatically, you could request this as a different labeling mode for the gauge, and we can see if it can get it in there.
-Graham