Chart Label Help

Thread is closed for posting
3 posts, 0 answers
  1. David
    David avatar
    57 posts
    Member since:
    Jan 2009

    Posted 07 Apr 2009 Link to this post

    I need a little bit of Chart help.

    Here is the end result: http://www.mccsokinawa.com/images/misc/chart.png

    See where it says Item 1, Item 2, Item 3? That should say NF, GS, and IHA.

    Here is my chart code:

    <telerik:RadChart ID="RadChart1" runat="server" Skin="Black" DataSourceID="dsFilledBillets">  
                <ChartTitle> 
                    <TextBlock Text="Filled Billets" /> 
                </ChartTitle> 
                <Series> 
                    <cc1:ChartSeries DataYColumn="COUNT" Name="COUNT" Type="Pie" DefaultLabelValue="#Y" Appearance-LegendDisplayMode="ItemLabels" /> 
                </Series> 
    </telerik:RadChart> 

    My datasources are set up correctly, and my data looks like this:

    Grade_Group        COUNT
    GS                         1
    IHA                         5
    NF                          19

    Straight forward question: How do I replace the Item 1, Item 2, and Item 3 with GS, IHA, and NF? Please help...
  2. Dessy
    Admin
    Dessy avatar
    73 posts

    Posted 07 Apr 2009 Link to this post

    Hello David,

    You can achieve the desirable functionality by using ItemDataBound event.
    Here is an example illustrating this:

    protected void RadChart1_ItemDataBound(object sender, ChartItemDataBoundEventArgs e)  
            {  
            ChartSeriesItem item = e.SeriesItem;  
            DataRowView dataItem = (DataRowView)e.DataItem;  
            item.Name = dataItem["Grade_Group"].ToString();  
            }  

    Hope that helps.

    Kind regards,

    Dessy
    the Telerik team

    Check out Telerik Trainer , the state of the art learning tool for Telerik products.
  3. David
    David avatar
    57 posts
    Member since:
    Jan 2009

    Posted 07 Apr 2009 Link to this post

    Perfect! Thank you! That is exactly what I needed!
Back to Top