This is a migrated thread and some comments may be shown as answers.

3D Doughnut Chart Help

2 Answers 123 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Henry
Top achievements
Rank 2
Henry asked on 21 Jan 2009, 06:12 PM
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.

Doughnut3DSeriesDefinition definition = new Doughnut3DSeriesDefinition();  
 
definition.LegendDisplayMode = LegendDisplayMode.DataPointLabel;  
 
radChart1.DefaultSeriesDefinition = definition;  
 
   
 
radChart1.DefaultView.ChartLegend.Header = "TEST DATA";  
 
SeriesMapping seriesMapping = new SeriesMapping();  
 
ItemMapping itemMapping = new ItemMapping();  
 
itemMapping.DataPointMember = DataPointMember.YValue;  
 
itemMapping.FieldName = "DoubleData";  
 
seriesMapping.ItemMappings.Add(itemMapping);  
 
ItemMapping itemMapping2 = new ItemMapping();  
 
itemMapping2.DataPointMember = DataPointMember.Label;  
 
itemMapping2.FieldName = "StringData";  
 
seriesMapping.ItemMappings.Add(itemMapping2);  
 
radChart1.SeriesMappings.Add(seriesMapping);  
 
DataTable tt = new DataTable();  
 
tt = GetDataTable();  
 
radChart1.ItemsSource = tt;  
 
 


 

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

Thanks,

Henry

 

2 Answers, 1 is accepted

Sort by
0
Henry
Top achievements
Rank 2
answered on 22 Jan 2009, 02:36 PM
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
0
Velin
Telerik team
answered on 26 Jan 2009, 05:26 PM
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.
Tags
Chart
Asked by
Henry
Top achievements
Rank 2
Answers by
Henry
Top achievements
Rank 2
Velin
Telerik team
Share this question
or