Example #1
0
        private void btn0_Click(object sender, EventArgs e)
        {
            DatabaseAccessor    dba      = new DatabaseAccessor();
            List <SubjectEntry> subjects = dba.BuildSubjectEntryList();

            for (int i = 0; i < subjects.Count; i++)
            {
                subjects[i].print();
            }

            Form2 Graphs = new Form2();

            Graphs.Show();
            //this.Close();
        }
Example #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            chart1.Show();
            DatabaseAccessor    dba      = new DatabaseAccessor();
            List <SubjectEntry> subjects = dba.BuildSubjectEntryList();

            List <double> xAxis = new List <double>();
            List <double> yAxis = new List <double>();

            for (int i = 0; i < subjects.Count; i++)
            {
                xAxis.Add(double.Parse(subjects[i].citricAcid));
                yAxis.Add(double.Parse(subjects[i].quality));
            }

            chart1.Series.Remove(chart1.Series[0]);
            chart1.Series.Add(new Series());
            chart1.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Point;

            chart1.Series[0].Name = "Citric Acid";
            chart1.Series[0].Points.DataBindXY(xAxis.ToArray(), yAxis.ToArray());

            /*
             * chart1.Show();
             * DatabaseAccessor dba = new DatabaseAccessor();
             * List<SubjectEntry> subjects = dba.BuildSubjectEntryList();
             *
             * chart1.Series.Remove(chart1.Series[0]);
             * chart1.Series.Add(new Series());
             * for (int i = 0; i < subjects.Count; i++)
             * {
             *  chart1.Series[0].Points.Add(float.Parse(subjects[i].citricAcid));
             * }
             *
             * chart1.Series[0].XValueMember = "ID";
             * chart1.Series[0].YValueMembers = "Citric Acid";
             * chart1.Series[0].Name = "Citric Acid";
             *
             * chart1.ChartAreas[0].RecalculateAxesScale();
             */
        }