Let's suppose I have a Winforms app with a Dictionary that looks like this:
private Dictionary<string, double> ChartCollection = new Dictionary<string, double>();
And let's suppose that I populate this dictionary with the number of each type of various foe which I've recently slain:
Ninja, 7
Pirate, 10
Space Cowboy, 4
Zombie, 8
Vampire, 7
Finally, let's suppose I bind a chart to this data like so:
chtAgentVersions.Series[0].Points.DataBindXY(ChartCollection.Keys, ChartCollection.Values);
This works flawlessly. I get my graph and a legend made up of my foe names and everything just fine. But when I try to apply this code:
chtAgentVersions.Series[0].Label = "#VALX (#PERCENT)";
...the labels on my legend change from their appropriate foe names to zeroes. Upon inspection of the Series after the databinding, I find that the names of my foes are actually not getting written to the XValues. I even tried this:
chtAgentVersions.Series[0].XValueType = System.Windows.Forms.DataVisualization.Charting.ChartValueType.String;
But, to no avail. Why are they all zeroes?