我创建了一个折线图。
XAML
<chartingToolkit:Chart HorizontalAlignment="Left" Margin="29,28,0,0" Name="chart1" VerticalAlignment="Top" Height="373" Width="400" DataContext="{Binding}" />
C#
System.Windows.Controls.DataVisualization.Charting.LineSeries LineSeries = new System.Windows.Controls.DataVisualization.Charting.LineSeries();
List<KeyValuePair<string, decimal>> valueList = new List<KeyValuePair<string, decimal>>();
DataTable dtblClass = new DataTable();
graphSP spGraph = new graphSP();
dtblClass = spGraph.ViewAll();
List<KeyValuePair<String, decimal>> test = new List<KeyValuePair<string, decimal>>();
foreach (DataRow dra in dtblClass.Rows)
{
valueList.Add(new KeyValuePair<string, decimal>((string)dra["customerName"], (decimal)dra["salary"]));
}
LineSeries.DependentValuePath = "Value";
LineSeries.IndependentValuePath = "Key";
LineSeries.ItemsSource = valueList;
LineSeries.Title = "Total Salay";
chart1.Series.Add(LineSeries);
如何在折线图数据点而不是值中显示弹出窗口。