Feature Suggestion: Floor and Ceiling functions on LinearAxis in Chart

Dec 11, 2009 at 2:47 AM

If no choices are made as to the Minimum and Maximum of a LinearAxis, the chart code chooses the exact min and max values to be plotted.  This is not always a desirable solution.  For instance, your graph could start at 23 with intervals of 100.  Likewise, without a priori knowledge of the values, hard coding the min and max values in the XAML will most likely produce undesirable graphs. 

I belive that it is a common scenerio in which it is desirable to round the min and max to the Floor and Ceiling values based on the Interval.  In other words, if the smallest number to be graphed is 22 and the Interval is 50, the the min would become 0.  If the largest value was 90 and the interval was 200, the max would become 200.  It might even be desirable to supply another paramter called MixMaxRounding that would be used instead of Interval. 

I can do (have done) this with some nasty binding for a graph that either does not change or only adds values.  The solution is harder for a graph that is displaying values vs a sliding time interval.  This solution will require monitoring the ObservableCollection that is bound to the data points for removals, so that the mins and maxs can be reset and recalculated.