Exemple #1
0
        /// <summary>
        /// Gets the text for the X-axis title.
        /// </summary>
        /// <param name="growth">The growth chart measure.</param>
        /// <returns>Returns a string for X-axis title.</returns>
        public static string GetHaxisTitle(GrowthTypes growth)
        {
            string title = string.Empty;

            switch (growth)
            {
            case GrowthTypes.BFA:
            case GrowthTypes.HCA:
            case GrowthTypes.LHFA:
            case GrowthTypes.MUAC:
            case GrowthTypes.SSF:
            case GrowthTypes.TSF:
            case GrowthTypes.WFA:
                title = "Age (months)";
                break;

            case (GrowthTypes.WFL):
                title = "Length (cm)";
                break;

            case (GrowthTypes.WFH):
                title = "Height (cm)";
                break;
            }
            return(title);
        }
        public void ShowGrowthChart(GrowthTypes growth, GraphTypes graph, Sexes sex, double x, double y, string title)
        {
            var parameters = new ModalParameters();

            parameters.Add(nameof(Chart.Growth), growth);
            parameters.Add(nameof(Chart.Graph), graph);
            parameters.Add(nameof(Chart.Sex), sex);
            parameters.Add(nameof(Chart.X), x);
            parameters.Add(nameof(Chart.Y), y);
            Modal.Show <Chart>(SetChartTitle(title, sex), parameters);
        }
Exemple #3
0
        /// <summary>
        /// Gets the text for the Y-axis title.
        /// </summary>
        /// <param name="growth">The growth chart measure.</param>
        /// <returns>Returns a string for Y-axis title.</returns>
        public static string GetVaxisTitles(GrowthTypes growth)
        {
            string title = string.Empty;

            switch (growth)
            {
            case GrowthTypes.BFA:
                title = "Body mass index";
                break;

            case GrowthTypes.HCA:
                title = "Head circumference (cm)";
                break;

            case GrowthTypes.LHFA:
                title = "Length/height (cm)";
                break;

            case GrowthTypes.MUAC:
                title = "MUAC (cm)";
                break;

            case GrowthTypes.SSF:
                title = "Subscapular skinfold (MM)";
                break;

            case GrowthTypes.TSF:
                title = "Triceps skinfold (MM)";
                break;

            case GrowthTypes.WFA:
            case (GrowthTypes.WFL):
            case (GrowthTypes.WFH):
                title = "Weight (kg)";
                break;
            }
            return(title);
        }
Exemple #4
0
        /// <summary>
        /// Gets the text for chart title.
        /// </summary>
        /// <param name="growth">The growth chart measure.</param>
        /// <returns>Returns a string for X-axis title.</returns>
        public static string GetTitle(GraphTypes graph, GrowthTypes growth)
        {
            string title = string.Empty;

            switch (graph)
            {
            case GraphTypes.PValue:
                switch (growth)
                {
                case GrowthTypes.BFA:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.HCA:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.LHFA:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.MUAC:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.SSF:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.TSF:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case GrowthTypes.WFA:
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case (GrowthTypes.WFL):
                    title = "Birth to 5 Years (Percentile)";
                    break;

                case (GrowthTypes.WFH):
                    title = "Birth to 5 Years (Percentile)";
                    break;
                }
                break;

            case GraphTypes.ZScore:
                switch (growth)
                {
                case GrowthTypes.BFA:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.HCA:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.LHFA:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.MUAC:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.SSF:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.TSF:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case GrowthTypes.WFA:
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case (GrowthTypes.WFL):
                    title = "Birth to 5 Years (Z-scores)";
                    break;

                case (GrowthTypes.WFH):
                    title = "Birth to 5 Years (Z-scores)";
                    break;
                }
                break;
            }
            return(title);
        }
Exemple #5
0
        /// <summary>
        /// Copies the elements of the List<Series> to a new array.
        /// </summary>
        /// <param name="graph"></param>
        /// <param name="growth"></param>
        /// <returns>Returns an array containing copies of the elements of the List<Series>.</returns>
        public static Series[] GetSeries(GraphTypes graph, GrowthTypes growth)
        {
            List <Series> series = new();

            switch (graph)
            {
            case (GraphTypes.PValue):
                switch (growth)
                {
                case GrowthTypes.BFA:
                case GrowthTypes.HCA:
                case GrowthTypes.LHFA:
                case GrowthTypes.MUAC:
                case GrowthTypes.SSF:
                case GrowthTypes.TSF:
                case GrowthTypes.WFA:
                case (GrowthTypes.WFL):
                case (GrowthTypes.WFH):
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#ffd700", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#0c8d00", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#ffd700", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "blue", visibleInLegend = false, type = "scatter", pointSize = 20
                    });
                    break;
                }
                break;

            case (GraphTypes.ZScore):
                switch (growth)
                {
                case GrowthTypes.BFA:
                case GrowthTypes.HCA:
                case GrowthTypes.MUAC:
                case GrowthTypes.SSF:
                case GrowthTypes.TSF:
                case (GrowthTypes.WFL):
                case (GrowthTypes.WFH):
                    series.Add(new Series {
                        color = "#000000", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#ffd700", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#0c8d00", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#ffd700", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#000000", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "blue", visibleInLegend = false, type = "scatter", pointSize = 20
                    });
                    break;

                case GrowthTypes.LHFA:
                case GrowthTypes.WFA:
                    series.Add(new Series {
                        color = "#000000", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#0c8d00", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#e10808", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "#000000", visibleInLegend = true, type = "linear", pointSize = 0
                    });
                    series.Add(new Series {
                        color = "blue", visibleInLegend = false, type = "scatter", pointSize = 20
                    });
                    break;
                }
                break;
            }

            // Gets items from Series list
            Series[] array = series.ToArray();
            return(array);
        }
Exemple #6
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="graph"></param>
        /// <param name="growth"></param>
        /// <returns>Returns an integer array of X-axis ticks.</returns>
        public static int[] GetHaxisTicks(GraphTypes graph, GrowthTypes growth)
        {
            int[] ticks = System.Array.Empty <int>();
            switch (graph)
            {
            case (GraphTypes.PValue):
                switch (growth)
                {
                case GrowthTypes.BFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.HCA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.LHFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.MUAC:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.SSF:
                    ticks = new[] { 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.TSF:
                    ticks = new[] { 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.WFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case (GrowthTypes.WFL):
                    ticks = new[] { 50, 60, 70, 80, 90, 100, 110 };
                    break;

                case (GrowthTypes.WFH):
                    ticks = new[] { 70, 80, 90, 100, 110, 120 };
                    break;
                }
                break;

            case (GraphTypes.ZScore):
                switch (growth)
                {
                case GrowthTypes.BFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.HCA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.MUAC:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.SSF:
                    ticks = new[] { 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.TSF:
                    ticks = new[] { 12, 24, 36, 48, 60 };
                    break;

                case (GrowthTypes.WFL):
                    ticks = new[] { 50, 60, 70, 80, 90, 100, 110 };
                    break;

                case (GrowthTypes.WFH):
                    ticks = new[] { 70, 80, 90, 100, 110, 120 };
                    break;

                case GrowthTypes.LHFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;

                case GrowthTypes.WFA:
                    ticks = new[] { 0, 12, 24, 36, 48, 60 };
                    break;
                }
                break;
            }
            return(ticks);
        }
Exemple #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="graph"></param>
        /// <param name="growth"></param>
        /// <returns>Returns an integer array of Y-axis ticks.</returns>
        public static int[] GetVaxisTicks(GraphTypes graph, GrowthTypes growth)
        {
            int[] ticks = System.Array.Empty <int>();
            switch (graph)
            {
            case (GraphTypes.PValue):
                switch (growth)
                {
                case GrowthTypes.BFA:
                    ticks = new[] { 8, 10, 12, 14, 16, 18, 20, 22, 24 };
                    break;

                case GrowthTypes.HCA:
                    ticks = new[] { 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54 };
                    break;

                case GrowthTypes.LHFA:
                    ticks = new[] { 40, 50, 60, 70, 80, 90, 100, 110, 120 };
                    break;

                case GrowthTypes.MUAC:
                    ticks = new[] { 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
                    break;

                case GrowthTypes.SSF:
                    ticks = new[] { 3, 4, 5, 6, 7, 8, 9, 10, 11 };
                    break;

                case GrowthTypes.TSF:
                    ticks = new[] { 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
                    break;

                case GrowthTypes.WFA:
                    ticks = new[] { 0, 5, 10, 15, 20, 25, 30 };
                    break;

                case (GrowthTypes.WFL):
                    ticks = new[] { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26 };
                    break;

                case (GrowthTypes.WFH):
                    ticks = new[] { 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28 };
                    break;
                }
                break;

            case (GraphTypes.ZScore):
                switch (growth)
                {
                case GrowthTypes.BFA:
                    ticks = new[] { 8, 10, 12, 14, 16, 18, 20, 22, 24 };
                    break;

                case GrowthTypes.HCA:
                    ticks = new[] { 28, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54 };
                    break;

                case GrowthTypes.MUAC:
                    ticks = new[] { 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
                    break;

                case GrowthTypes.SSF:
                    ticks = new[] { 4, 6, 8, 10, 12, 14, 16, 18 };
                    break;

                case GrowthTypes.TSF:
                    ticks = new[] { 4, 6, 8, 10, 12, 14, 16, 18, 20 };
                    break;

                case (GrowthTypes.WFL):
                    ticks = new[] { 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26 };
                    break;

                case (GrowthTypes.WFH):
                    ticks = new[] { 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 32 };
                    break;

                case GrowthTypes.LHFA:
                    ticks = new[] { 40, 50, 60, 70, 80, 90, 100, 110, 120 };
                    break;

                case GrowthTypes.WFA:
                    ticks = new[] { 0, 5, 10, 15, 20, 25, 30 };
                    break;
                }
                break;
            }
            return(ticks);
        }