在运行时设置LiveChart ChartPoint.Fill

时间:2018-06-14 13:57:27

标签: c# wpf livecharts

如何在运行时设置ChartPoint.Fill属性?我只能在编译时定义Mapper来设置ChartPoint.Fill,但我不能在运行时设置它的.Fill属性(例如悬停或其他GUI绑定)。

// Cannot set ChartPoint.Fill in run time
private void CartesianChart_Hover(object sender, ChartPoint chartPoint)
{
   chartPoint.Fill = new SolidColorBrush(Colors.Blue);
}

// My mapper that set ChartPoint.Fill in compile time
fooMapper = Mappers.Xy<ObservableValue>()
    .X((item, index) => index)
    .Y(item => item.Value)
    .Fill(item => (item.Value >= 5.0 ? new SolidColorBrush(Colors.Red))

0 个答案:

没有答案