title: ASP.NET chart control: pie chart and custom sized labels
body: <p>Consider a pie chart using <a href="http://weblogs.asp.net/scottgu/archive/2008/11/24/new-asp-net-charting-control-lt-asp-chart-runat-quot-server-quot-gt.aspx" rel="nofollow noreferrer">the ASP.NET charting controls</a>.</p>
  
  <p>The requirement is around controlling the text that's rendered on the pie chart. The goal is to limit the number of characters on the label. The chart currently is bound to a <code>SqlDataSource</code>.</p>
  
  <p><a href="http://www.imagechicken.com/uploads/1250716996036841800.png" rel="nofollow noreferrer">alt text http://www.imagechicken.com/uploads/1250716996036841800.png</a></p>
  
  <pre><code>&lt;asp:Chart ID="myPieChart" runat="server" DataSourceID="myDS"&gt;
    &lt;Series&gt;
        &lt;asp:Series ChartArea="myChartArea" Name="Series1" ChartType="Pie" 
                    XValueType="Int32" XValueMember="SomeName" 
                    YValueMembers="SomeNumber"&gt;
        &lt;/asp:Series&gt;
   &lt;/Series&gt;
   &lt;ChartAreas&gt;
       &lt;asp:ChartArea Name="myChartArea"&gt;
         &lt;AxisY Title="Number"&gt;&lt;/AxisY&gt;
         &lt;AxisX Title="Name"&gt;&lt;/AxisX&gt;
         &lt;Area3DStyle Enable3D="True" Inclination="20" /&gt;
       &lt;/asp:ChartArea&gt;
   &lt;/ChartAreas&gt;
  &lt;/asp:Chart&gt;
  </code></pre>
  
  <p><strong>Question</strong>
  How would you specify, either in the <code>&lt;asp:Chart&gt;</code> markup, or in code-behind, to limit the number of characters that are bound/rendered to the pie chart?</p>