当前位置: 首页>>代码示例>>C#>>正文


C# Series.AddElements方法代码示例

本文整理汇总了C#中Series.AddElements方法的典型用法代码示例。如果您正苦于以下问题:C# Series.AddElements方法的具体用法?C# Series.AddElements怎么用?C# Series.AddElements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Series的用法示例。


在下文中一共展示了Series.AddElements方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ShowCharting

        public void ShowCharting(DataSet ds)
        {
            this.ds = ds;
            chart1.Type = ChartType.Combo;

            //init Series
            ArrayList CollectIdList = this.getCollectIdList();
            foreach (string CollectId in CollectIdList)
            {
                Series series = new Series(CollectId);
                series.Type = SeriesType.Line;
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (CollectId == row["CollectId"].ToString())
                    {
                        Element elem = new Element();
                        //elem.XDateTime = Convert.ToDateTime(row["DataTime"].ToString());
                        elem.YValue = Convert.ToDouble(row["DataValue"].ToString());
                        series.AddElements(elem);
                    }
                }

                this.chart1.SeriesCollection.Add(series);
            }
        }
开发者ID:amedinarcr,项目名称:fop,代码行数:25,代码来源:DataCharting.cs

示例2: ShowCharting2

        public void ShowCharting2(DataSet ds)
        {
            this.ds = ds;
            chart1.Type = ChartType.Combo;

            //init Series
            Series series = new Series();
            series.Type = SeriesType.Line;
            foreach (DataRow row in ds.Tables[0].Rows)
            {
                Element elem = new Element();
                //elem.XValue = Convert.ToInt16(row["CollectId"].ToString());
                elem.YValue = Convert.ToDouble(row["DataValue"].ToString());
                series.AddElements(elem);
            }
            this.chart1.SeriesCollection.Add(series);
        }
开发者ID:amedinarcr,项目名称:fop,代码行数:17,代码来源:DataCharting.cs

示例3: BuildBurndownChart

        public static ChartViewModel BuildBurndownChart(Iteration iteration, List<Assignable> tasks)
        {
            SeriesCollection sc;
            Series s;

            sc = new SeriesCollection();

            s = new Series();
            s.Name = "Effort";
            s.Type = SeriesType.Bar;
            //s.DefaultElement.ShowValue = true;

            for (var day = iteration.StartDate.Date; day.Date <= iteration.EndDate.AddDays(1).Date; day = day.AddDays(1))
            {
                var remainingTime = 0.0;
                //Do not show values for future dates.
                if (day <= DateTime.Today.AddDays(1))
                {
                    foreach (var task in tasks)
                    {
                        if (task.Times.Items.Count == 0)
                        {
                            remainingTime += task.Effort;
                        }
                        else
                        {
                            //NOTE: The Remain property on a Time object represents only the remaining time for that role (ie/ developer/qa) so we can't use it here.
                            var timeSpent = task.Times.Items.Where(t => t.Date.Date < day).Sum(t => t.Spent);
                            remainingTime += task.Effort - timeSpent;
                        }
                    }
                }
                s.AddElements(new Element(day.ToShortDateString(), remainingTime));
            }

            sc.Add(s);

            var chart = InitializeBarGraph(sc, "Time Remaining");
            return new ChartViewModel
                        {
                            ImageFileName = string.Format("{0:s}/{1:s}.png", chart.TempDirectory, chart.FileName)
                        };
        }
开发者ID:rkurz,项目名称:Cerebro,代码行数:43,代码来源:ChartService.cs

示例4: backgroundWorker1_DoWork

        private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)
        {
            SeriesCollection sc = new SeriesCollection();

            foreach (object o in ethnicities)
            {
                if (o is EthnicityFrequency.EthnicityStat)
                {
                    Series theSeries = new Series();
                    EthnicityFrequency.EthnicityStat stat = (EthnicityFrequency.EthnicityStat)o;
                    Element elem = new Element();
                    theSeries.Name = stat.racialBackground;
                    elem.Name = stat.racialBackground;
                    elem.YValue = stat.frequency;
                    total += stat.frequency;
                    theSeries.AddElements(elem);
                    sc.Add(theSeries);
                }
            }
            e.Result = sc;
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:21,代码来源:EthnicityFrequencyControl.cs

示例5: LoadChart

        private void LoadChart()
        {
            all = mutationRisk.Count();
            low = mutationRisk.Where(mr => ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro== 0 &&
                                            ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0
                                    ).Count();

            mid = mutationRisk.Where(mr => (
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1 ||
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1
                                            )
                                             &&
                                            !(
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 ||
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2
                                            )
                                    ).Count();

            high = mutationRisk.Where(mr => (
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2 ||
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2
                                            )
                                    ).Count();

            passed = mutationRisk.Where(mr =>
                                            (
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1 ||
                                                ((LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1
                                            )
                                        ).Count();

            SeriesCollection sc = new SeriesCollection();

            Series mmrpro = new Series("MMRPro");
            Series premm = new Series("PREMM");

            mmrpro.LegendEntry.Value = "";
            premm.LegendEntry.Value = "";

            Element mmrpro_elem0 = new Element();
            mmrpro_elem0.Name = "0-4%";
            mmrpro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 0).Count();
            mmrpro.AddElements(mmrpro_elem0);
            Element mmrpro_elem1 = new Element();
            mmrpro_elem1.Name = "5-9%";
            mmrpro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 1).Count();
            mmrpro.AddElements(mmrpro_elem1);
            Element mmrpro_elem2 = new Element();
            mmrpro_elem2.Name = "10% or Greater";
            mmrpro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro == 2).Count();
            mmrpro.AddElements(mmrpro_elem2);

            Element premm__elem0 = new Element();
            premm__elem0.Name = "0-4%";
            premm__elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 0).Count();
            premm.AddElements(premm__elem0);
            Element premm__elem1 = new Element();
            premm__elem1.Name = "5-9%";
            premm__elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 1).Count();
            premm.AddElements(premm__elem1);
            Element premm__elem2 = new Element();
            premm__elem2.Name = "10% or Greater";
            premm__elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM == 2).Count();
            premm.AddElements(premm__elem2);

            sc.Add(mmrpro);
            sc.Add(premm);

            chart1.SeriesCollection.Add(sc);

            SeriesCollection passedCollection = new SeriesCollection();
            Series mmrpro_passed = new Series("MMRPro");
            Series premm__passed = new Series("PREMM");

            Element mmrpro_yes = new Element();
            mmrpro_yes.Name = "At or Above Threshold";
            mmrpro_yes.Color = Color.Red;
            mmrpro_yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 1).Count();
            mmrpro_passed.AddElements(mmrpro_yes);

            Element mmrpro_no = new Element();
            mmrpro_no.Name = "Below Threshold";
            mmrpro_no.Color = Color.White;
            mmrpro_no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).MMRPro_passed == 0).Count();
            mmrpro_passed.AddElements(mmrpro_no);

            Element premm__yes = new Element();
            premm__yes.Name = "At or Above Threshold";
            premm__yes.Color = Color.Red;
            premm__yes.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 1).Count();
            premm__passed.AddElements(premm__yes);

            Element premm__no = new Element();
            premm__no.Name = "Below Threshold";
            premm__no.Color = Color.White;
            premm__no.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.LynchRiskFrequency.LynchMutationRisk)mr).PREMM_passed == 0).Count();
            premm__passed.AddElements(premm__no);

            passedCollection.Add(mmrpro_passed);
            passedCollection.Add(premm__passed);
//.........这里部分代码省略.........
开发者ID:mahitosh,项目名称:HRA4,代码行数:101,代码来源:LynchRiskFrequencyControl.cs

示例6: LoadChart

        private void LoadChart()
        {
            all = breastRisk.Count();
            non = breastRisk.Where(mr =>    ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0).Count();

            low = breastRisk.Where(mr =>    ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                            ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0 &&
                                            ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0 &&
                                            ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0 &&
                                            ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 0
                                    ).Count();

            mid = breastRisk.Where(mr =>    ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                            (
                                                ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 1
                                            )
                                             &&
                                            !(
                                                ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2
                                            )
                                    ).Count();

            high = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                            (
                                                ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 2 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC7 == 2
                                            )
                                    ).Count();

            passed = breastRisk.Where(mr =>    ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                            (
                                                ((BreastRiskFrequency.BreastRiskStat)mr).Claus_passed == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO_passed == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC6_passed == 1 ||
                                                ((BreastRiskFrequency.BreastRiskStat)mr).TC7_passed == 1
                                            )
                                        ).Count();

            SeriesCollection sc = new SeriesCollection();

            Series brcapro = new Series("BRCAPRO");
            Series claus = new Series("Claus");
            Series TC6 = new Series("TC6");
            Series TC7 = new Series("TC7");

            brcapro.LegendEntry.Value = "";
            claus.LegendEntry.Value = "";
            TC6.LegendEntry.Value = "";
            TC7.LegendEntry.Value = "";

            Element brcapro_elem0 = new Element();
            brcapro_elem0.Name = "0-14%";
            brcapro_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 0).Count();
            brcapro.AddElements(brcapro_elem0);
            Element brcapro_elem1 = new Element();
            brcapro_elem1.Name = "15-19%";
            brcapro_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 1).Count();
            brcapro.AddElements(brcapro_elem1);
            Element brcapro_elem2 = new Element();
            brcapro_elem2.Name = "20% or Greater";
            brcapro_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).BRCAPRO == 2).Count();
            brcapro.AddElements(brcapro_elem2);

            Element claus_elem0 = new Element();
            claus_elem0.Name = "0-14%";
            claus_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 0).Count();
            claus.AddElements(claus_elem0);
            Element claus_elem1 = new Element();
            claus_elem1.Name = "15-19%";
            claus_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 1).Count();
            claus.AddElements(claus_elem1);
            Element claus_elem2 = new Element();
            claus_elem2.Name = "20% or Greater";
            claus_elem2.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).Claus == 2).Count();
            claus.AddElements(claus_elem2);

            Element TC6_elem0 = new Element();
            TC6_elem0.Name = "0-14%";
            TC6_elem0.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 0).Count();
            TC6.AddElements(TC6_elem0);
            Element TC6_elem1 = new Element();
            TC6_elem1.Name = "15-19%";
            TC6_elem1.YValue = breastRisk.Where(mr => ((BreastRiskFrequency.BreastRiskStat)mr).BreastCancer == 0 &&
                                                          ((BreastRiskFrequency.BreastRiskStat)mr).TC6 == 1).Count();
            TC6.AddElements(TC6_elem1);
//.........这里部分代码省略.........
开发者ID:mahitosh,项目名称:HRA4,代码行数:101,代码来源:BreastRiskFrequencyControl.cs

示例7: LoadChart

        private void LoadChart()
        {
            SeriesCollection sc = new SeriesCollection();

            Series cancerSeries = new Series("Breast Cancer");
            cancerSeries.DefaultElement.Color = Color.LightBlue;

            Element unilateral_elem = new Element();
            unilateral_elem.Name = "Unilateral Breast Cancer";
            unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1 &&
                                                           ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count();
            uni_bc = (int)unilateral_elem.YValue;
            total_bc += uni_bc;
            cancerSeries.AddElements(unilateral_elem);

            Element bilateral_elem = new Element();
            bilateral_elem.Name = "Bilateral Breast Cancer";
            bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2 &&
                                                          ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 0).Count();
            bil_bc = (int)bilateral_elem.YValue;
            total_bc += bil_bc;
            cancerSeries.AddElements(bilateral_elem);

            Element ovarian_elem = new Element();
            ovarian_elem.Name = "Ovarian Cancers";
            ovarian_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 &&
                                                        ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 0).Count();
            oc = (int)ovarian_elem.YValue;
            cancerSeries.AddElements(ovarian_elem);

            Element ovarian_unilateral_elem = new Element();
            ovarian_unilateral_elem.Name = "Ovarian and Unilateral Breast Cancer";
            ovarian_unilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 &&
                                                                   ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 1).Count();
            oc_uni = (int)ovarian_unilateral_elem.YValue;
            total_bc += oc_uni;
            cancerSeries.AddElements(ovarian_unilateral_elem);

            Element ovarian_bilateral_elem = new Element();
            ovarian_bilateral_elem.Name = "Ovarian and Bilateral Breast Cancer";
            ovarian_bilateral_elem.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcCount == 1 &&
                                                                   ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcCount == 2).Count();
            oc_bil = (int)ovarian_bilateral_elem.YValue;
            total_bc += oc_bil;
            cancerSeries.AddElements(ovarian_bilateral_elem);

            sc.Add(cancerSeries);

            chart1.SeriesCollection.Add(sc);

            SeriesCollection sc2 = new SeriesCollection();

            Series passed_series = new Series();
            passed_series.DefaultElement.Color = Color.Red;

            Element bc_passed = new Element();
            bc_passed.Name = "High Risk by Age of Breast Cancer";
            bc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count();
            hr_bc = (int)bc_passed.YValue;
            passed_series.Elements.Add(bc_passed);

            Element oc_passed = new Element();
            oc_passed.Name = "High Risk by Ovarian Cancer Dx";
            oc_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1).Count();
            hr_oc = (int)oc_passed.YValue;
            passed_series.Elements.Add(oc_passed);

            Element either_passed = new Element();
            either_passed.Name = "High Risk by Breast Cancer Age or Ovarian Cancer Dx";
            either_passed.YValue = frequency.Where(mr => ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).OcPassed == 1 ||
                                                         ((RiskApps3.Model.Clinic.Reports.BrOvCancerFrequency.BrOvCancerStat)mr).BcPassed == 1).Count();
            hr_both = (int)either_passed.YValue;
            passed_series.Elements.Add(either_passed);

            sc2.Add(passed_series);

            chart2.SeriesCollection.Add(sc2);
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:78,代码来源:BrOvCancerFrequencyControl.cs

示例8: LoadChart

        private void LoadChart()
        {
            all = mutationRisk.Count();
            low = mutationRisk.Where(mr => ((MutationRiskFrequency.MutationRisk)mr).Myriad == 0 &&
                                            ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0 &&
                                            ((MutationRiskFrequency.MutationRisk)mr).TC6 == 0 &&
                                            ((MutationRiskFrequency.MutationRisk)mr).TC7 == 0
                                    ).Count();

            mid = mutationRisk.Where(mr => (
                                                ((MutationRiskFrequency.MutationRisk)mr).Myriad == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC6 == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC7 == 1
                                            )
                                             &&
                                            !(
                                                ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2
                                            )
                                    ).Count();

            high = mutationRisk.Where(mr => (
                                                ((MutationRiskFrequency.MutationRisk)mr).Myriad == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC6 == 2 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC7 == 2
                                            )
                                    ).Count();

            passed = mutationRisk.Where(mr =>
                                            (
                                                ((MutationRiskFrequency.MutationRisk)mr).Myriad_passed == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).BRCAPRO_passed == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC6_passed == 1 ||
                                                ((MutationRiskFrequency.MutationRisk)mr).TC7_passed == 1
                                            )
                                        ).Count();

            SeriesCollection sc = new SeriesCollection();

            Series brcapro = new Series("BRCAPRO");
            Series myriad = new Series("Myriad");
            Series TC6 = new Series("TC6");
            Series TC7 = new Series("TC7");

            brcapro.LegendEntry.Value = "";
            myriad.LegendEntry.Value = "";
            TC6.LegendEntry.Value = "";
            TC7.LegendEntry.Value = "";

            Element brcapro_elem0 = new Element();
            brcapro_elem0.Name = "0-4%";
            brcapro_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 0).Count();
            brcapro.AddElements(brcapro_elem0);
            Element brcapro_elem1 = new Element();
            brcapro_elem1.Name = "5-9%";
            brcapro_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 1).Count();
            brcapro.AddElements(brcapro_elem1);
            Element brcapro_elem2 = new Element();
            brcapro_elem2.Name = "10% or Greater";
            brcapro_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).BRCAPRO == 2).Count();
            brcapro.AddElements(brcapro_elem2);

            Element myriad_elem0 = new Element();
            myriad_elem0.Name = "0-4%";
            myriad_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 0).Count();
            myriad.AddElements(myriad_elem0);
            Element myriad_elem1 = new Element();
            myriad_elem1.Name = "5-9%";
            myriad_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 1).Count();
            myriad.AddElements(myriad_elem1);
            Element myriad_elem2 = new Element();
            myriad_elem2.Name = "10% or Greater";
            myriad_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).Myriad == 2).Count();
            myriad.AddElements(myriad_elem2);

            Element TC6_elem0 = new Element();
            TC6_elem0.Name = "0-4%";
            TC6_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 0).Count();
            TC6.AddElements(TC6_elem0);
            Element TC6_elem1 = new Element();
            TC6_elem1.Name = "5-9%";
            TC6_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 1).Count();
            TC6.AddElements(TC6_elem1);
            Element TC6_elem2 = new Element();
            TC6_elem2.Name = "10% or Greater";
            TC6_elem2.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC6 == 2).Count();
            TC6.AddElements(TC6_elem2);

            Element TC7_elem0 = new Element();
            TC7_elem0.Name = "0-4%";
            TC7_elem0.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 0).Count();
            TC7.AddElements(TC7_elem0);
            Element TC7_elem1 = new Element();
            TC7_elem1.Name = "5-9%";
            TC7_elem1.YValue = mutationRisk.Where(mr => ((RiskApps3.Model.Clinic.Reports.MutationRiskFrequency.MutationRisk)mr).TC7 == 1).Count();
            TC7.AddElements(TC7_elem1);
//.........这里部分代码省略.........
开发者ID:mahitosh,项目名称:HRA4,代码行数:101,代码来源:MutationRiskFrequencyControl.cs

示例9: GetResponseData

    SeriesCollection GetResponseData (OrganizationMetadata metadata)
    {
        Organization organization = Organization.PPSE;

        CommunicationTurnarounds turnarounds = CommunicationTurnarounds.ForOrganization(organization, true);

        SeriesCollection collection = new SeriesCollection();

        DateTime today = DateTime.Today;
        DateTime dateIterator = today.AddDays(-90);

        int currentIndex = 0;

        // Prepare averages

        DateTime now = DateTime.Now;

        Dictionary<DateTime, int> caseCountOpen = new Dictionary<DateTime, int>();
        Dictionary<DateTime, int> caseCountResponded = new Dictionary<DateTime, int>();
        Dictionary<DateTime, double> caseTimeOpen = new Dictionary<DateTime, double>();
        Dictionary<DateTime, double> caseTimeResponded = new Dictionary<DateTime, double>();

        foreach (CommunicationTurnaround turnaround in turnarounds)
        {
            if (turnaround.Open)
            {
                if (!caseCountOpen.ContainsKey(turnaround.DateTimeOpened.Date))
                {
                    caseCountOpen[turnaround.DateTimeOpened.Date] = 0;
                    caseTimeOpen[turnaround.DateTimeOpened.Date] = 0.0;
                }

                caseCountOpen[turnaround.DateTimeOpened.Date]++;
                caseTimeOpen[turnaround.DateTimeOpened.Date] += (now - turnaround.DateTimeOpened).TotalHours;
            }
            else if (turnaround.Responded)
            {
                if (!caseCountResponded.ContainsKey(turnaround.DateTimeOpened.Date))
                {
                    caseCountResponded[turnaround.DateTimeOpened.Date] = 0;
                    caseTimeResponded[turnaround.DateTimeOpened.Date] = 0.0;
                }

                caseCountResponded[turnaround.DateTimeOpened.Date]++;
                caseTimeResponded[turnaround.DateTimeOpened.Date] += (turnaround.DateTimeFirstResponse-turnaround.DateTimeOpened).TotalHours;
            }
        }

        Series seriesOpen = new Series();
        seriesOpen.Name = "Still open";
        seriesOpen.DefaultElement.Color = Color.Orange;
        Series seriesResponded = new Series();
        seriesResponded.Name = "Responded";
        seriesResponded.DefaultElement.Color = Color.DarkGreen;

        int dateLabel = -90;

        while (dateIterator < today)
        {
            double avgTimeResponded = 0.0;
            double avgTimeOpen = 0.0;

            if (caseCountOpen.ContainsKey(dateIterator))
            {
                avgTimeOpen = caseTimeOpen[dateIterator]/(double) caseCountOpen[dateIterator];
            }
            if (caseCountResponded.ContainsKey(dateIterator))
            {
                avgTimeResponded = caseTimeResponded[dateIterator]/(double) caseCountResponded[dateIterator];
            }

            Element elementOpen = new Element();
            elementOpen.XValue = dateLabel;
            elementOpen.YValue = avgTimeOpen - avgTimeResponded;
            seriesOpen.AddElements(elementOpen);

            Element elementResponded = new Element();
            elementResponded.XValue = dateLabel;
            elementResponded.YValue = avgTimeResponded;
            seriesResponded.AddElements(elementResponded);

            dateIterator = dateIterator.AddDays(1);
            dateLabel++;
        }

        collection.Add(seriesResponded);
        collection.Add(seriesOpen);

        return collection;

    }
开发者ID:SwarmCorp,项目名称:Swarmops,代码行数:91,代码来源:MailResponseTimes.aspx.cs

示例10: LoadChart

        private void LoadChart()
        {
            SeriesCollection sc = new SeriesCollection();

            Series mmrpro_colon_series = new Series("MMRPRO - Colon Cancer");
            Series mmrpro_endo_series = new Series("MMRPRO - Endometrial Cancer");
            Series CCRAT_series = new Series("CCRAT - Colon Cancer");

            mmrpro_colon_series.LegendEntry.Value = "";
            mmrpro_endo_series.LegendEntry.Value = "";
            CCRAT_series.LegendEntry.Value = "";

            int cap = 5;

            for (int i = 0; i < cap; i++)
            {
                Element mmrpro_colon = new Element();
                mmrpro_colon.Name = GetElementName(i);
                if (i == cap)
                {
                    mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon >= i).Count();
                }
                else
                {
                    mmrpro_colon.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Colon == i).Count();
                }
                mmrpro_colon_series.AddElements(mmrpro_colon);

                Element mmrpro_endo = new Element();
                mmrpro_endo.Name = GetElementName(i);
                if (i == cap)
                {
                    mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo >= i).Count();
                }
                else
                {
                    mmrpro_endo.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).MMRPRO_Lifetime_Endo == i).Count();
                }
                mmrpro_endo_series.AddElements(mmrpro_endo);

                Element ccrat_elem = new Element();
                ccrat_elem.Name = GetElementName(i);
                if (i == cap)
                {
                    ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT >= i).Count();
                }
                else
                {
                    ccrat_elem.YValue = colonRisk.Where(mr => ((ColonRiskFrequency.ColonRiskStat)mr).CCRAT == i).Count();
                }
                CCRAT_series.AddElements(ccrat_elem);
            }

            sc.Add(mmrpro_colon_series);
            sc.Add(mmrpro_endo_series);
            sc.Add(CCRAT_series);

            chart1.SeriesCollection.Add(sc);
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:59,代码来源:ColonRiskFrequencyControl.cs

示例11: LoadChart

        private void LoadChart()
        {
            SeriesCollection sc = new SeriesCollection();

            Series ColoRectal = new Series("Lynch Syndrome Cancers");
            ColoRectal.DefaultElement.Color = Color.LightBlue;

            Element coloRectal_elem = new Element();
            coloRectal_elem.Name = "ColoRectal Cancer";
            coloRectal_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0 &&
                                                           ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount == 0).Count();
            colorectal += (int)coloRectal_elem.YValue;
            ColoRectal.AddElements(coloRectal_elem);

            Element endoUterine_elem = new Element();
            endoUterine_elem.Name = "Endometrial or Uterine Cancer";
            endoUterine_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 &&
                                                          ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount == 0).Count();
            endouterine += (int)endoUterine_elem.YValue;
            ColoRectal.AddElements(endoUterine_elem);

            Element both_elem = new Element();
            both_elem.Name = "Both";
            both_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EndoUterineCount > 0 &&
                                                        ((LynchCancerFrequency.LynchCancerStat)mr).ColoRectalCount > 0).Count();
            both += (int)both_elem.YValue;
            ColoRectal.AddElements(both_elem);

            Element hr_elem = new Element();
            hr_elem.Name = "Early Age of Dx";
            hr_elem.YValue = frequency.Where(mr => ((LynchCancerFrequency.LynchCancerStat)mr).EarlyDx > 0).Count();
            hr += (int)both_elem.YValue;
            ColoRectal.AddElements(hr_elem);

            sc.Add(ColoRectal);

            chart1.SeriesCollection.Add(sc);
        }
开发者ID:mahitosh,项目名称:HRA4,代码行数:38,代码来源:LynchCancerFrequencyControl.cs


注:本文中的Series.AddElements方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。