Exemple #1
0
        public void addChartEvolutionSeries(Eleve eleve, Matiere matiere)
        {
            Series s = new Series
            {
                ChartType = SeriesChartType.Line
            };

            s.BorderWidth = 3;
            int i = 0;

            s.IsValueShownAsLabel = true;
            s.Name     = matiere.intitule;
            Login.read = DBConnect.Gets(string.Format("SELECT avg(note), titre FROM examiner where id_etudiant = {0} and id_groupe = {1} and id_matiere = {2} group by titre order by titre", eleve.id, this.id_class, matiere.id));
            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[1].ToString(), Math.Round(float.Parse(Login.read[0].ToString()), 2));
                s.Points[i].MarkerSize    = 9;
                s.Points[i++].MarkerStyle = MarkerStyle.Circle;
            }
            Login.read.Close();
            this.c.Series.Add(s);
            MaterialSkin.Controls.MaterialCheckBox b = new MaterialSkin.Controls.MaterialCheckBox();
            b.Text    = s.Name;
            b.Checked = true;
            this.series_bs.Add(b);
            b.CheckedChanged += B_Click;
        }
Exemple #2
0
        public void addChartEvolutionUnites(Eleve eleve, Matiere matiere)
        {
            Series s = new Series
            {
                ChartType = SeriesChartType.Column
            };

            int i = 0;

            s.IsValueShownAsLabel = true;
            s.Name     = matiere.intitule;
            Login.read = DBConnect.Gets("Select unite , avg(note) from examiner,annee where id_matiere=" + matiere.id + " and  id_etudiant=" + eleve.id + " and id_annee=annee.id and annee.annee_scolaire='" + HomePreview.idann + "' group by unite");
            Random r = new Random();

            while (Login.read.Read())
            {
                s.Points.AddXY(Login.read[0].ToString(), Math.Round(float.Parse(Login.read[1].ToString()), 2));
                s.Points[i].MarkerSize = 9;
                s.Points[i++].Color    = Color.FromArgb(r.Next(150, 256), r.Next(0, 256), r.Next(0, 256), r.Next(0, 256));
            }
            Login.read.Close();

            MaterialSkin.Controls.MaterialRadioButton bb = new MaterialSkin.Controls.MaterialRadioButton();
            this.c.Series.Add(s);
            bb.Text = s.Name;
            this.series_bb.Add(bb);
            bb.CheckedChanged += Bb_Click;
        }