示例#1
0
        public ExcelChart Add(string chartName, ExcelChartType chartType)
        {
            ExcelChart newChart = ChartFactory.CreateChart(chartType, chartName, this._FirstChart.WorkSheet);

            this._List.Add(newChart);

            return(newChart);
        }
示例#2
0
        public ExcelChart AddChart(string chartName, ExcelChartType chartType)
        {
            ExceptionHelper.TrueThrow(this._DrawingNames.ContainsKey(chartName.ToLower()), "已存在相同名{0}", chartName);

            ExceptionHelper.TrueThrow <NotImplementedException>(chartType == ExcelChartType.Bubble || chartType == ExcelChartType.Bubble3DEffect || chartType == ExcelChartType.Radar ||
                                                                chartType == ExcelChartType.RadarFilled || chartType == ExcelChartType.RadarMarkers || chartType == ExcelChartType.StockHLC ||
                                                                chartType == ExcelChartType.StockOHLC || chartType == ExcelChartType.StockVOHLC || chartType == ExcelChartType.Surface ||
                                                                chartType == ExcelChartType.SurfaceTopView || chartType == ExcelChartType.SurfaceTopViewWireframe || chartType == ExcelChartType.SurfaceWireframe, "在当前版本不支持图表类型");

            ExcelChart newChart = ChartFactory.CreateChart(chartType, chartName, this._WorkSheet);

            this.AddWrapper(chartName, newChart);

            return(newChart);
        }