Profile Picture

Pie Chart Backward Compatibility

Posted By Vahid Mesri 6 Years Ago
Author
Message
Vahid Mesri
Problem Posted 6 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 67
Hi,
We have recently updated the Nevron component on our server to the latest version. Unfortunately the following lines couldn't be compiled for one of our existing pie charts:

series1.BeginAngle = 90;
series1.InnerRadius = new NLength(30, NRelativeUnit.ParentPercentage);
series1.Radius = new NLength(50, NRelativeUnit.ParentPercentage);


Where Series1 is a NPieChart:
NPieChart pieChart1 = context.document.Charts[0] as NPieChart;

Can you please tell us how we can set the mentioned properties for the pie chart?

Thanks a lot,
Vahid

Nevron Support
Posted 6 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000

Hi Vahid,

The BeginAngle, Radius and InnerRadius are member of NPieChart - in previous versions of the control they were members of the NPieSeries - which was not correct in our view. The following code shows how to specify those properties in a simple pie chart:

   nChartControl1.Panels.Clear();

   NPieChart pieChart = new NPieChart();

   nChartControl1.Panels.Add(pieChart);
   pieChart.BeginAngle = 90;
   pieChart.InnerRadius = new NLength(30, NRelativeUnit.ParentPercentage);
   pieChart.Radius = new NLength(50, NRelativeUnit.ParentPercentage);

   NPieSeries pieSeries = new NPieSeries();
   pieSeries.PieStyle = PieStyle.Ring;
   pieSeries.Values.Add(10);
   pieSeries.Values.Add(20);
   pieSeries.Values.Add(30);
   pieChart.Series.Add(pieSeries);

Hope this helps - let us know if you meet any problems or have any questions.


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic