我正在 xaml.cs 文件中绘制图表,例如
chart = new RadCartesianChart();
chart.Name = "Chart";
chart.Margin = new Thickness(10,20,10,20);
chart.BorderThickness = new Thickness(1);
chart.Background = new SolidColorBrush(Colors.LightGray);
chart.BorderBrush = new SolidColorBrush(Colors.Black);
ObservableCollection<MultiSeries> multiseries = mainWindowViewModel.GetSeies(Row, Col);
multiseries.ToList().ForEach(series =>
{
chart.Series.Add(SeriesHelper.getLineSeries(series));
}
chart.SetValue(Grid.ColumnProperty, Col);
chart.SetValue(Grid.RowProperty, Row);
ChartGrid.Children.Add(chart);
我正在尝试向该图表添加工具提示和图例 但我不知道如何添加工具提示和图例。
最佳答案
使用此语句:
chart.Behaviors.Add(new ChartTooltipBehavior());
关于c# - 使用 xaml.cs 文件添加图例和工具提示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25155771/