3D Doughnut Chart Help

3 posts, 0 answers
  1. Henry
    Henry avatar
    14 posts
    Member since:
    Dec 2008

    Posted 21 Jan 2009 Link to this post

    Hi,

    I'm trying to create a 3D Dougnut Chart, but are having troubles with the Series Mapping. Using the code below, I get the legend to show color coded items equal to the amount of rows in the table. But nothing else displays.

    1 Doughnut3DSeriesDefinition definition = new Doughnut3DSeriesDefinition();  
    2  
    3 definition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;  
    4  
    5 radChart1.DefaultSeriesDefinition = definition;  
    6  
    7    
    8  
    9 radChart1.DefaultView.ChartLegend.Header = "TEST DATA";  
    10  
    11 SeriesMapping seriesMapping = new SeriesMapping();  
    12  
    13 ItemMapping itemMapping = new ItemMapping();  
    14  
    15 itemMapping.DataPointMember = DataPointMember.YValue;  
    16  
    17 itemMapping.FieldName = "DoubleData";  
    18  
    19 seriesMapping.ItemMappings.Add(itemMapping);  
    20  
    21 ItemMapping itemMapping2 = new ItemMapping();  
    22  
    23 itemMapping2.DataPointMember = DataPointMember.Label;  
    24  
    25 itemMapping2.FieldName = "StringData";  
    26  
    27 seriesMapping.ItemMappings.Add(itemMapping2);  
    28  
    29 radChart1.SeriesMappings.Add(seriesMapping);  
    30  
    31 DataTable tt = new DataTable();  
    32  
    33 tt = GetDataTable();  
    34  
    35 radChart1.ItemsSource = tt;  
    36  
    37  


     

    Any help would be much appreciated. Not really sure how the charting works.

    Thanks,

    Henry

     

  2. Henry
    Henry avatar
    14 posts
    Member since:
    Dec 2008

    Posted 22 Jan 2009 Link to this post

    Hi There,

    I have managed to resolve my issue. The problem was that my LayoutContainer in the root of my XAML file was not a Grid, but a stack panel. After changing it to a Grid, the Chart displayed correctly.

    This however raises the issue then of dependancies with the Charting compenent. I will do some additional testing further down the Component model to further understand this.

    Can you guys please confirm whether there is some underlaying dependancy on the Charts having to sit in a Grid at the root level?

    Thanks,

    Henry
  3. UI for WPF is Visual Studio 2017 Ready
  4. Velin
    Admin
    Velin avatar
    391 posts

    Posted 26 Jan 2009 Link to this post

    Hi Henry,

    The different behavior of RadChart when contained in StackPanel and Grid is caused by the differences in the measurement mechanisms of these containers. While the grid panel measures its children against the available space, the stack panel with vertical orientation measures its children against infinite height. What we would recommend you to do in this case is to set the Height property of RadChart to an appropriate value.

    I will forward this issue to our developers to further investigate the issue and think of the possible ways to improve this behavior.

    Your Telerik points have been updated. Thanks.

    Greetings,
    Velin
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top