Profile Picture

Nested/hierarchical pie charts

Posted By Kevin Harrison 10 Years Ago
Author
Message
Kevin Harrison
Posted 10 Years Ago
View Quick Profile
Supreme Being

Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)Supreme Being (79 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 176, Visits: 1,865

Are there any plans to add this type of chart; i.e. a pie chart that displays two or more sets of data as rings within the full pie?

Thanks

Kevin



Nevron Support
Posted 10 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009
Hi Kevin,

Currently a pie chart can display only a single series. We have plans to implement support for multiple pie series for "doughnut" charts, but at this point it's not a top priority.

It is possible to emulate this feature using two pie charts (please see the code below). This is a workaround though, so it has some limitations - first it doesn't work for real 3D charts (works for 2D and for 3D in ortho 2D projection), and second - cannot be used along with the non-overlapping pie labels mode.


      private void Form1_Load(object sender, EventArgs e)
      {
         nChartControl1.Panels.Clear();

         // first chart (outer)
         NPieChart pieChart1 = new NPieChart();
         nChartControl1.Charts.Add(pieChart1);
         NPieSeries series1 = new NPieSeries();
         pieChart1.Series.Add(series1);
         series1.LabelMode = PieLabelMode.Center;
         series1.Values.AddRange(new double[]{10, 20, 15});
         series1.PieStyle = PieStyle.Ring;
         series1.InnerRadius = new NLength(30, NRelativeUnit.ParentPercentage);
         series1.Radius = new NLength(50, NRelativeUnit.ParentPercentage);
         series1.FillStyles[0] = new NColorFillStyle(Color.IndianRed);
         series1.FillStyles[1] = new NColorFillStyle(Color.Goldenrod);
         series1.FillStyles[2] = new NColorFillStyle(Color.OliveDrab);

         // second chart (inner)
         NPieChart pieChart2 = new NPieChart();
         nChartControl1.Charts.Add(pieChart2);
         NPieSeries series2 = new NPieSeries();
         pieChart2.Series.Add(series2);
         series2.LabelMode = PieLabelMode.Center;
         series2.Values.AddRange(new double[] { 7, 4, 8 });
         series2.PieStyle = PieStyle.Ring;
         series2.InnerRadius = new NLength(10, NRelativeUnit.ParentPercentage);
         series2.Radius = new NLength(30, NRelativeUnit.ParentPercentage);
         series2.FillStyles[0] = new NColorFillStyle(Color.IndianRed);
         series2.FillStyles[1] = new NColorFillStyle(Color.Goldenrod);
         series2.FillStyles[2] = new NColorFillStyle(Color.OliveDrab);
      }


Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic