|
<chart:StackingColumnSeries XBindingPath="XValue" SegmentColorPath="Color"
ListenPropertyChange="True"
YBindingPath="YValue" ItemsSource="{Binding Data}"/>
|
|
bool canUpdateHighValue = true;
private void Button_Click(object sender, RoutedEventArgs e)
{
var collection = chart.Series[0].ItemsSource as ObservableCollection<Model>;
if (canUpdateHighValue)
collection[0].YValue = 15;
else
collection[0].YValue = 5;
canUpdateHighValue = !canUpdateHighValue;
}
public double YValue
{
get { return yValue; }
set
{
yValue = value;
NotifyPropertyChanged();
if (value > 10)
Color = redColor;
else
Color = greenColor;
}
} |