예제 #1
0
        public void CarRentToChart(DateTime dt)
        {
            RadioButton(true);


            chart1.Palette = ChartColorPalette.SeaGreen;
            chart1.ChartAreas[0].AxisX.LabelStyle.Interval = 1;

            chart1.Titles.Clear();
            chart1.Titles.Add("Distribution");

            SortedDictionary <string, int> dictionary = new SortedDictionary <string, int>();
            OrderRentArr orderArr = new OrderRentArr();

            orderArr.Fill();

            ProductArr productArr = orderArr.GetProductArr();
            CarArr     carArr     = productArr.GetCarArr();

            foreach (Car car in carArr)
            {
                Count = orderArr.Filter(car, dt).Count;
                if (Count > 0)
                {
                    dictionary.Add(car.Category + "" + car.Model, Count);
                }
            }

            Series series = new Series("Products", productArr.Count);

            series.ChartType = SeriesChartType.Column;

            series.Label = "[#PERCENT{P0}]";
            series.Points.DataBindXY(dictionary.Keys, dictionary.Values);

            chart1.Series.Clear();
            chart1.Series.Add(series);
        }