Ejemplo n.º 1
0
        private void classesDistributionToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormForPie WindowForClassesDistribution = new FormForPie();
            WindowForClassesDistribution.Text = "Classes Distributions";

            int[] ListClasses = cGlobalInfo.CurrentScreening.GetClassPopulation();

            Series CurrentSeries = WindowForClassesDistribution.chartForPie.Series[0];

            int NumberOfWells = cGlobalInfo.CurrentScreening.GetNumberOfActiveWells();
            int IdxPt = 0;
            //  CurrentSeries.CustomProperties = "PieLabelStyle=Outside";
            for (int Idx = 0; Idx < ListClasses.Length; Idx++)
            {

                if (ListClasses[Idx] == 0)
                {

                    continue;
                }
                CurrentSeries.Points.Add(ListClasses[Idx]);
                CurrentSeries.Points[IdxPt].Color = cGlobalInfo.ListWellClasses[Idx].ColourForDisplay;
                CurrentSeries.Points[IdxPt].Label = String.Format("{0:0.###}", ((100.0 * ListClasses[Idx]) / NumberOfWells)) + " %";

                CurrentSeries.Points[IdxPt].LegendText = "Class " + Idx;
                CurrentSeries.Points[IdxPt].ToolTip = ListClasses[Idx] + " / " + NumberOfWells;
                IdxPt++;
            }

            WindowForClassesDistribution.Show();
        }