04-18-2016 01:29 PM
Maybe it's a weird request but I hope there's a good way to handle it.
I have a Graph control with X Axis set to Adjuster="FitExactly" and it works beautifully on window initialization.
Thing is, we want to be able to manually adjust X value (by editing the last X value on the Graph X Axis) and keep this value if data is reloaded. At the monent it's reset due to FitExactly setting.
What would be the best solution for this?
Thank you.
Solved! Go to Solution.
04-18-2016 02:22 PM
The simplest approach might be to use a custom RangeAdjuster
implementation that uses the current range until FitExactly
returns a different value:
public sealed class CachedRangeAdjuster : RangeAdjuster {
private IRange previousRange;
protected override Range<TData> GetAdjustedRangeCore<TData>( RangeAdjusterArgs<TData> args ) {
Range<TData> exactRange = FitExactly.GetAdjustedRange<TData>( args );
Range<TData> result;
if( object.Equals( previousRange, exactRange ) ) {
result = args.Range;
}
else {
previousRange = exactRange;
result = exactRange;
}
return result;
}
}
04-19-2016 09:06 AM
Thanks!
Will try once I get back from vacation.