Beispiel #1
0
        public void Diagramfeltoltes()
        {
            var szurt = from x in rendeles
                        group x by x.Datum into Datumok
                        select new
            {
                Napok     = Datumok.Key.Date,
                Darabszám = Datumok.Count()
            };

            dataGridView1.DataSource = szurt.ToList();

            chart1.DataSource = szurt.ToList();

            var series = chart1.Series[0];

            series.ChartType     = SeriesChartType.Line;
            series.XValueMember  = "Napok";
            series.YValueMembers = "Darabszám";
            series.BorderWidth   = 3;
            series.Color         = Color.Orange;

            var legend = chart1.Legends[0];

            legend.Enabled = false;

            var chartArea = chart1.ChartAreas[0];

            chartArea.AxisX.MajorGrid.Enabled = false;
            chartArea.AxisY.MajorGrid.Enabled = false;
            chartArea.AxisY.IsStartedFromZero = false;
        }
Beispiel #2
0
        private void designedButton1_Click(object sender, EventArgs e)
        {
            int nap   = rng.Next(1, 30);
            int honap = 12;
            int ev    = 2020;

            disabledTextBox1.Text = ev + "." + honap + "." + nap;

            var szurt = from x in rendeles
                        where x.Datum.Day == nap
                        group x by x.Datum into Datumok
                        select new
            {
                napok     = Datumok.Key.Date,
                darabszam = Datumok.Count()
            };

            var darabszam = (from y in szurt
                             select y.darabszam).First().ToString();

            disabledTextBox2.Text = darabszam;
        }