If you change
KeyValuePair<double, double>[] CallDeltaYRange = new KeyValuePair<double, double>[1];
CallDeltaYRange[0] = new KeyValuePair<double, double>(CallDeltaVector.Min(), CallDeltaVector.Max());
CallDeltaGraphYAxis.DataContext = CallDeltaYRange;
to instead create an instance of this class...
CallDeltaYRangeInfo cvRange = new CallDeltaYRangeInfo{Ymax = CallDeltaVector.Max(), Ymin = CallDeltaVector.Min()};
Where the class is defined like...
public class CallDeltaYRangeInfo : INotifyPropertyChanged
{
private double _yMin;
public double Ymin
{
[DebuggerStepThrough]
get { return _yMin; }
[DebuggerStepThrough]
set
{
if (Math.Abs(value - _yMin) > 1e-6)
{
_yMin = value;
OnPropertyChanged("Ymin");
}
}
}
private double _yMax;
public double Ymax
{
[DebuggerStepThrough]
get { return _yMax; }
[DebuggerStepThrough]
set
{
if (Math.Abs(value - _yMax) > 1e-6)
{
_yMax = value;
OnPropertyChanged("Ymax");
}
}
}
#region INotifyPropertyChanged Implementation
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void OnPropertyChanged(string name)
{
var handler = System.Threading.Interlocked.CompareExchange(ref PropertyChanged, null, null);
if (handler != null)
{
handler(this, new PropertyChangedEventArgs(name));
}
}
#endregion
}
... then you can assign CallDeltaGraphYAxis.DataContext to that instance and you will see a better result.
<charting:LinearAxis x:Name="CallDeltaGraphYAxis" Orientation="Y" Minimum="{Binding Ymin}" Maximum="{Binding Ymax}" ShowGridLines="True" />