title: Can I show both label and value on a pie chart label in MSChart
body: <p>I have a chart of type Doughnut from the Microsoft Chart Controls (in namespace System.Web.UI.DataVisualization.Charting).</p>
  
  <p>The data I'm binding to my chart's series is of type <code>Dictionary&lt;string, int&gt;</code> where the label is the key of the dictionary, and the value is the <code>Value</code> property.  I want my labels on the pie chart to look like this: <code>Some label (4)</code>, where "Some label" is the key of an entry in the dictionary, and 4 is the value.</p>
  
  <p>I've tried various combinations of <code>IsValueShownAsLabel</code> and <code>LabelFormat</code>, but this doesn't help as it shows only the value.</p>
  
  <p>I've come up with the following code which does what i want but, quite frankly, the last three lines (which set the labels) scare me!</p>
  
  <pre><code>Dictionary&lt;string, int&gt; myDictionary = GetMyDataForTheChart();
  var mySeries = Chart1.Series.Add("MySeries");
  mySeries.Points.DataBind(myDictionary, "Key", "Value", null);
  int i = 0;
  foreach (var p in mySeries.Points)
      p.Label = myDictionary.ElementAt(i++).Key + " (" + p.YValues[0].ToString("0") + ")";
  </code></pre>
  
  <p>Is there a better way?</p>