Customize Pie Chart

3 posts, 0 answers
  1. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 04 Mar 2010 Link to this post

    I just created a Pie Chart using data from a database (using webservices).
    For this i retrieved the data and put in a List.

    PieDataList

     

    PieResult = new PieDataList();

     

     

    while (reader.Read())

     

    {

    PieResult.Add(

    new PieData {Naam = reader["Name"].ToString(),Percentage = Convert.ToInt32(reader["Value"])});

     

     

    }

    Later I make sure my data is shown in a Pie Chart.

     

    SeriesMapping

     

    sm = new SeriesMapping();

     

    sm.ItemMappings.Add(

    new ItemMapping("Percentage", DataPointMember.YValue));

     

    sm.ItemMappings.Add(

    new ItemMapping("Naam", DataPointMember.LegendLabel));

     

     

    PieChart1.SeriesMappings.Add(sm);

    PieChart1.DefaultSeriesDefinition =

    new PieSeriesDefinition() { ShowItemLabels = false };

     

    PieChart1.ItemsSource = e.Result;

     

    How can I now change the color of one particular object in my list?
    And is it possible to show the values of my objects (Percentage) in the chart?

    Kind regards,

    Gj

  2. Dwight
    Admin
    Dwight avatar
    475 posts

    Posted 08 Mar 2010 Link to this post

    Hi GJ DM,

    Currently there is no way of changing the color of a particular object (if by object you mean pie slice). In the Q1 2010 version, which is to be released in a couple of days, we did rework the RadChart styling to allow easy color customizations.

    For the object values, please, review the Format Expressions help topic.

    All the best,
    Joshua
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Grtjn
    Grtjn avatar
    129 posts
    Member since:
    Feb 2010

    Posted 08 Mar 2010 Link to this post

    Ok,

    Thanks for the reply !

    Gj
Back to Top