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

Add 2 Pipe chart runtime

2 Answers 75 Views
Chart
This is a migrated thread and some comments may be shown as answers.
A Mahdavi
Top achievements
Rank 1
A Mahdavi asked on 03 Nov 2010, 02:28 PM
Hi,
I am adding 2  DataSeries into DefaultView.ChartArea, but only one of them shown in a time.
How I can show, data series together in a time in one rad chart ?
ConfigureMonthlySales(radchart.DefaultView.ChartArea, lsdata1);
ConfigureMonthlySales(radchart.DefaultView.ChartArea, lsdata2);
.....
.....
 
private void ConfigureMonthlySales(ChartArea chartArea, List<KeyValuePair<string, double>> lsData)
        {
            DataSeries doughnutSeries = new DataSeries();
 
            foreach (KeyValuePair<string, double> data in lsData)
            {
                DataPoint point = new DataPoint();
                point.YValue = data.Value;
                point.LegendLabel = data.Key;
                doughnutSeries.Add(point);
            }
 
            doughnutSeries.Definition = new DoughnutSeriesDefinition();
 
            ((DoughnutSeriesDefinition)doughnutSeries.Definition).LabelSettings.LabelOffset = 0.7d;
            doughnutSeries.Definition.ItemLabelFormat = "#%{p0}";
            doughnutSeries.Definition.ShowItemToolTips = true;
            chartArea.DataSeries.Add(doughnutSeries);
             
            chartArea.SmartLabelsEnabled = false;
        }


Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Evgenia
Telerik team
answered on 05 Nov 2010, 06:48 PM
Hello,

Actually both DataSeries are shown on the Chart Area at same time but they overlap, so it seems there is only one. For pie and doughnut chart you can use two ChartAreas so that each Doughnut is located in it's own Area as described in this help topic -  http://www.telerik.com/help/silverlight/radchart-populating-with-data-data-binding-to-many-chart-areas.html. You can also find RadChart configured with more than one ChartArea in our First Look online example.

Regards,
Evgenia
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
0
A Mahdavi
Top achievements
Rank 1
answered on 06 Nov 2010, 06:58 AM
Dear Evgenia ,

Thanks a lot.
Tags
Chart
Asked by
A Mahdavi
Top achievements
Rank 1
Answers by
Evgenia
Telerik team
A Mahdavi
Top achievements
Rank 1
Share this question
or