I created a ScatterSeries chart using the following:
public ScatterPlot()
{
InitializeComponent();
ScatterSeries a = new ScatterSeries();
a.Title = "Series A";
a.IndependentValuePath = "Key";
a.DependentValuePath = "Value";
scatterplot.Series.Add(a);
((ScatterSeries)scatterplot.Series[0]).ItemsSource = new KeyValuePair<DateTime, int>[]
{
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(1), 0),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(2), 150),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(3), 150),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(4), 0),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(5), 0),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(8), 130),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(9), 130),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(10), 0),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(11), 0),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(15), 225),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(16), 225),
new KeyValuePair<DateTime, int>(DateTime.Now.AddMonths(17), 0)
};
}
I have a dictionary where every data point is mapped to a separate text label. I was wondering if it is possible to establish a binding such that when I move my mouse over a point, I get the text label instead of the actual number? Any suggestions on how to do this?