Пример #1
0
        private void PopulateCategory(GalleryCategory category, PageControlPage page)
        {
            ListView listView = new ListView();

            listView.Parent                = page;
            listView.Location              = new Point(16, 32);
            listView.Size                  = new Size(page.Width - 16, page.Height - 32);
            listView.LargeImageList        = ChartGallery.Images;
            listView.BorderStyle           = BorderStyle.None;
            listView.SelectedIndexChanged += new EventHandler(listView_SelectedIndexChanged);
            listView.DoubleClick          += new EventHandler(listView_DoubleClick);

            foreach (GalleryItem item in category.Items)
            {
                ListViewItem lvItem = listView.Items.Add(Res.Get("Forms,ChartGallery,Series," + item.Name));
                lvItem.ImageIndex = item.ImageIndex;
                lvItem.Tag        = item.SeriesType;
            }
        }
Пример #2
0
        static ChartGallery()
        {
            Categories        = new List <GalleryCategory>();
            Images            = new ImageList();
            Images.ImageSize  = new Size(96, 72);
            Images.ColorDepth = ColorDepth.Depth32Bit;

            SmallImages            = new ImageList();
            SmallImages.ImageSize  = new Size(48, 36);
            SmallImages.ColorDepth = ColorDepth.Depth32Bit;

            GalleryCategory category = new GalleryCategory("BarColumn");

            category.Items.Add(new GalleryItem(SeriesChartType.Bar, "Bar"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedBar, "StackedBar"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedBar100, "StackedBar100"));
            category.Items.Add(new GalleryItem(SeriesChartType.Column, "Column"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedColumn, "StackedColumn"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedColumn100, "StackedColumn100"));
            Categories.Add(category);

            category = new GalleryCategory("Area");
            category.Items.Add(new GalleryItem(SeriesChartType.Area, "Area"));
            category.Items.Add(new GalleryItem(SeriesChartType.SplineArea, "SplineArea"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedArea, "StackedArea"));
            category.Items.Add(new GalleryItem(SeriesChartType.StackedArea100, "StackedArea100"));
            Categories.Add(category);

            category = new GalleryCategory("Line");
            category.Items.Add(new GalleryItem(SeriesChartType.Line, "Line"));
            category.Items.Add(new GalleryItem(SeriesChartType.FastLine, "FastLine"));
            category.Items.Add(new GalleryItem(SeriesChartType.StepLine, "StepLine"));
            category.Items.Add(new GalleryItem(SeriesChartType.Spline, "Spline"));
            Categories.Add(category);

            category = new GalleryCategory("PointBubble");
            category.Items.Add(new GalleryItem(SeriesChartType.Bubble, "Bubble"));
            category.Items.Add(new GalleryItem(SeriesChartType.Point, "Point"));
            category.Items.Add(new GalleryItem(SeriesChartType.FastPoint, "FastPoint"));
            Categories.Add(category);

            category = new GalleryCategory("Pie");
            category.Items.Add(new GalleryItem(SeriesChartType.Pie, "Pie"));
            category.Items.Add(new GalleryItem(SeriesChartType.Doughnut, "Doughnut"));
            Categories.Add(category);

            category = new GalleryCategory("Circular");
            category.Items.Add(new GalleryItem(SeriesChartType.Polar, "Polar"));
            category.Items.Add(new GalleryItem(SeriesChartType.Radar, "Radar"));
            Categories.Add(category);

            category = new GalleryCategory("Financial");
            category.Items.Add(new GalleryItem(SeriesChartType.Stock, "Stock"));
            category.Items.Add(new GalleryItem(SeriesChartType.Candlestick, "Candlestick"));
            category.Items.Add(new GalleryItem(SeriesChartType.Kagi, "Kagi"));
            category.Items.Add(new GalleryItem(SeriesChartType.Renko, "Renko"));
            category.Items.Add(new GalleryItem(SeriesChartType.PointAndFigure, "PointAndFigure"));
            category.Items.Add(new GalleryItem(SeriesChartType.ThreeLineBreak, "ThreeLineBreak"));
            Categories.Add(category);

            category = new GalleryCategory("PyramidFunnel");
            category.Items.Add(new GalleryItem(SeriesChartType.Pyramid, "Pyramid"));
            category.Items.Add(new GalleryItem(SeriesChartType.Funnel, "Funnel"));
            Categories.Add(category);

            category = new GalleryCategory("Range");
            category.Items.Add(new GalleryItem(SeriesChartType.Range, "Range"));
            category.Items.Add(new GalleryItem(SeriesChartType.SplineRange, "SplineRange"));
            category.Items.Add(new GalleryItem(SeriesChartType.RangeColumn, "RangeColumn"));
            category.Items.Add(new GalleryItem(SeriesChartType.RangeBar, "RangeBar"));
            Categories.Add(category);
        }