private void ChartLoad()
        {
            Chart.Series.Clear();
            Baza.DB          baza         = new Baza.DB();
            string           createSeries = "select NazivMaterijala from skladiste";
            SQLiteDataReader nazivi       = baza.GraphReaders(createSeries);
            DateTime         trenutno     = DateTime.Now;
            DateTime         now          = new DateTime(trenutno.Year, trenutno.Month, trenutno.Day);
            int i = 0;

            Chart.ChartAreas[0].AxisX.MajorGrid.LineWidth = 0;
            Chart.ChartAreas[0].AxisY.MajorGrid.LineWidth = 0;
            while (nazivi.Read())
            {
                int c = 0;
                Chart.Series.Add(nazivi.GetString(0));
                string           allData = string.Format("select kolicina, date(datum),nazivmaterijala from Evidencija join Poveznica on Evidencija.ID=Poveznica.Id_Evidencija and Poveznica.NazivMaterijala=" + '"' + "{0}" + '"' + " order by datum", nazivi.GetString(0));
                SQLiteDataReader data    = baza.GraphReaders(allData);
                Chart.Series[i].ChartType   = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.StepLine;
                Chart.Series[i].BorderWidth = 5;
                while (data.Read())
                {
                    c = c + data.GetInt32(0);
                    Chart.Series[i].Points.AddXY(data.GetDateTime(1), c);
                }
                Chart.Series[i].Points.AddXY(now, c);
                i++;
            }
        }
Exemple #2
0
        private void ChartLoad()
        {
            int              i             = 0;
            string           SveEvidencije = "select DISTINCT  date(Datum) from Evidencija";
            SQLiteDataReader data          = baza.GraphReaders(SveEvidencije);

            Chart.Series[0].ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Column;
            while (data.Read())
            {
                DateTime         date = data.GetDateTime(0);
                string           brojZaOdređeniDatum = string.Format("select count (ID) from Evidencija where date(datum)=" + '"' + "{0}" + '"', data.GetString(0));
                SQLiteDataReader count = baza.GraphReaders(brojZaOdređeniDatum);
                while (count.Read())
                {
                    i = Convert.ToInt32(count.GetValue(0));
                }
                Chart.Series[0].Points.AddXY(data.GetDateTime(0), i);
            }
        }