Esempio n. 1
0
        //*********   Méthodes**************
        ///

        public void addHyst(string nomParam, string abrev) //Ajoute un Hystogramme
        {
            if (Can())                                     //Si un parametre est checké
            {
                string               attr   = GetTheChekcedAttr();
                List <double>        Donnee = inputSynthese.GetAttribut(attr);
                ChartValues <double> values = GetValues(attr, abrev);
                var converter = new BrushConverter();
                var brush     = (Brush)converter.ConvertFromString(GetColor(nomParam));

                if (firstHist)
                {
                    this.Hysto.Series = new SeriesCollection
                    {
                        new ColumnSeries
                        {
                            Title  = nomParam,
                            Values = values,
                            Stroke = brush,
                            Fill   = brush
                        }
                    };
                    firstHist = false;
                }
                else
                {
                    this.Hysto.Series.Add(
                        new ColumnSeries
                    {
                        Title  = nomParam,
                        Values = values,
                        Stroke = brush,
                        Fill   = brush
                    }
                        );
                }
                DataContext = this;
            }

            else
            {
                (new MessageBoxWindow("Veuillez choisir un paramètre d'abord", false)).ShowDialog();
                Uncheck();
            }
            titre.Text           = GetTitle1();
            AxisY.LabelFormatter = values => values + GetFormatter();
        }
Esempio n. 2
0
        private ChartValues <double> GetValues(String attribut)
        {
            List <Observation> Obs = new List <Observation>();

            Obs = inputSynthese.periode;
            List <String> labels = GetLAbels();

            axisX.Labels = labels;  //On mets les labels dans l'axis
            List <double> Values = new List <double>();

            if (inputSynthese.ByMonth())
            {
                Values = inputSynthese.GetMoyAttribut(attribut);
                return(DoubleToChartValues(Values));
            }
            //else
            Values = inputSynthese.GetAttribut(attribut);
            return(DoubleToChartValues(Values));
        }