Nevron Forum

Pie Chart Backward Compatibility

https://www.nevron.com/Forum/Topic12472.aspx

By Vahid Mesri - Tuesday, June 5, 2018

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
By Nevron Support - Tuesday, June 5, 2018

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.