Exemplo n.º 1
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            using (GalleryForm form = new GalleryForm())
            {
                if (form.ShowDialog() == DialogResult.OK)
                {
                    ChartArea area = ChartObject.Chart.ChartAreas[0];
                    bool      newChartAreaNeeded = form.SelectedSeriesType == SeriesChartType.Pie ||
                                                   form.SelectedSeriesType == SeriesChartType.Doughnut ||
                                                   form.SelectedSeriesType == SeriesChartType.Funnel ||
                                                   form.SelectedSeriesType == SeriesChartType.Pyramid ||
                                                   form.SelectedSeriesType == SeriesChartType.Kagi ||
                                                   form.SelectedSeriesType == SeriesChartType.Renko ||
                                                   form.SelectedSeriesType == SeriesChartType.PointAndFigure ||
                                                   form.SelectedSeriesType == SeriesChartType.ThreeLineBreak;
                    if (form.NewArea || newChartAreaNeeded)
                    {
                        if (ChartObject.Series.Count > 0)
                        {
                            area = new ChartArea();
                            ChartObject.Chart.ChartAreas.Add(area);
                        }
                    }

                    MSChartSeries series = ChartObject.AddSeries(form.SelectedSeriesType);
                    series.SeriesSettings.ChartArea = area.Name;
                    series.CreateDummyData();
                    PopulateSeriesTree(series);
                    RefreshSample();
                }
            }
        }
Exemplo n.º 2
0
        /// <inheritdoc/>
        public override void OnBeforeInsert(int flags)
        {
            base.OnBeforeInsert(flags);
            MSChartSeries series = AddSeries(SeriesChartType.Column);

            series.CreateDummyData();
        }