/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelRadarChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with radar chart;chartType</exception> public ExcelRadarChart(ExcelChartType chartType) { if (((chartType != ExcelChartType.Radar) && (chartType != ExcelChartType.RadarWithMarkers)) && (chartType != ExcelChartType.FilledRadar)) { throw new ArgumentException("The specified chart type is not compitible with radar chart", "chartType"); } this.ChartType = chartType; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelSurfaceChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with surface chart;chartType</exception> public ExcelSurfaceChart(ExcelChartType chartType) { if ((chartType != ExcelChartType.SurfaceViewedAbove) && (chartType != ExcelChartType.SurfaceViewedAboveWireFrame)) { throw new ArgumentException("The specified chart type is not compitible with surface chart", "chartType"); } this.ChartType = chartType; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelStockChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> public ExcelStockChart(ExcelChartType chartType) { if ((chartType != ExcelChartType.StockHighLowClose) && (chartType != ExcelChartType.StockOpenHighLowClose)) { throw new ArgumentException("The specified chart type is not compitible with stock chart", "chartType"); } this.ChartType = chartType; }
private string GetBarDirection(ExcelChartType chartType) { if (((((chartType != ExcelChartType.ColumnClustered3D) && (chartType != ExcelChartType.ColumnStacked3D)) && ((chartType != ExcelChartType.ColumnStacked100Percent3D) && (chartType != ExcelChartType.Column3D))) && (((chartType != ExcelChartType.CylinderColumnClustered) && (chartType != ExcelChartType.CylinderColumnStacked)) && ((chartType != ExcelChartType.CylinderColumnStacked100Percent) && (chartType != ExcelChartType.CylinderColumn3D)))) && ((((chartType != ExcelChartType.ConeColumnClustered) && (chartType != ExcelChartType.ConeColumnStacked)) && ((chartType != ExcelChartType.ConeColumnStacked100Percent) && (chartType != ExcelChartType.ConeColumn3D))) && (((chartType != ExcelChartType.PyramidColumnClustered) && (chartType != ExcelChartType.PyramidColumnStacked)) && ((chartType != ExcelChartType.PyramidColumnStacked100Percent) && (chartType != ExcelChartType.PyramidColumn3D))))) { return("bar"); } return("col"); }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelAreaChart" /> class. /// </summary> /// <param name="areaChartType">Type of the area chart.</param> public ExcelAreaChart(ExcelChartType areaChartType) { if (((areaChartType != ExcelChartType.Area) && (areaChartType != ExcelChartType.AreaStacked)) && (areaChartType != ExcelChartType.AreaStacked100Percent)) { throw new ArgumentException("The specified chart type is not compitible with area chart", "chartType"); } this.ChartType = areaChartType; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelScatterChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with scatter chart;chartType</exception> public ExcelScatterChart(ExcelChartType chartType) { if (((chartType != ExcelChartType.Scatter) && (chartType != ExcelChartType.ScatterLines)) && (((chartType != ExcelChartType.ScatterLinesSmooth) && (chartType != ExcelChartType.ScatterLinesSmoothWithMarkers)) && (chartType != ExcelChartType.ScatterLinesWithMarkers))) { throw new ArgumentException("The specified chart type is not compitible with scatter chart", "chartType"); } this.ChartType = chartType; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelLineChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with line chart;chartType</exception> public ExcelLineChart(ExcelChartType chartType) { if ((((chartType != ExcelChartType.Line) && (chartType != ExcelChartType.LineStacked)) && ((chartType != ExcelChartType.LineStacked100Percent) && (chartType != ExcelChartType.LineStacked100PercentWithMarkers))) && ((chartType != ExcelChartType.LineStackedWithMarkers) && (chartType != ExcelChartType.LineWithMarkers))) { throw new ArgumentException("The specified chart type is not compitible with line chart", "chartType"); } this.ChartType = chartType; }
public ExcelChart Add(string chartName, ExcelChartType chartType) { ExcelChart newChart = ChartFactory.CreateChart(chartType, chartName, this._FirstChart.WorkSheet); this._List.Add(newChart); return(newChart); }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelPieChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> public ExcelPieChart(ExcelChartType chartType) { if ((chartType != ExcelChartType.Pie) && (chartType != ExcelChartType.ExplodedPie)) { throw new ArgumentException("The specified chart type is not compitible with Pie chart", "chartType"); } this.ChartType = chartType; this.VaryColors = true; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelDoughnutChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with Doughnut chart;chartType</exception> public ExcelDoughnutChart(ExcelChartType chartType) { if ((chartType != ExcelChartType.Doughunt) && (chartType != ExcelChartType.DoughuntExploded)) { throw new ArgumentException("The specified chart type is not compitible with Doughnut chart", "chartType"); } this.ChartType = chartType; this.VaryColors = true; this.HoleSize = 10; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelBarChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> public ExcelBarChart(ExcelChartType chartType) { if ((((chartType != ExcelChartType.ColumnClustered) && (chartType != ExcelChartType.ColumnStacked)) && ((chartType != ExcelChartType.ColumnStacked100Percent) && (chartType != ExcelChartType.BarClustered))) && ((chartType != ExcelChartType.BarStacked) && (chartType != ExcelChartType.BarStacked100Percent))) { throw new ArgumentException("The specified chart type is not compitible with Bar chart", "chartType"); } this.ChartType = chartType; this.VaryColors = false; this.Overlap = 0; this.GapWidth = 150; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelBar3DChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with Bar 3D chart;chartType</exception> public ExcelBar3DChart(ExcelChartType chartType) { if ((((((chartType != ExcelChartType.ColumnClustered3D) && (chartType != ExcelChartType.ColumnStacked3D)) && ((chartType != ExcelChartType.ColumnStacked100Percent3D) && (chartType != ExcelChartType.BarClustered3D))) && (((chartType != ExcelChartType.BarStacked3D) && (chartType != ExcelChartType.BarStacked100Percent3D)) && ((chartType != ExcelChartType.Column3D) && (chartType != ExcelChartType.CylinderColumnClustered)))) && ((((chartType != ExcelChartType.CylinderColumnStacked) && (chartType != ExcelChartType.CylinderColumnStacked100Percent)) && ((chartType != ExcelChartType.CylinderBarClustered) && (chartType != ExcelChartType.CylinderBarStacked))) && (((chartType != ExcelChartType.CylinderBarStacked100Percent) && (chartType != ExcelChartType.CylinderColumn3D)) && ((chartType != ExcelChartType.ConeColumnClustered) && (chartType != ExcelChartType.ConeColumnStacked))))) && (((((chartType != ExcelChartType.ConeColumnStacked100Percent) && (chartType != ExcelChartType.ConeBarClustered)) && ((chartType != ExcelChartType.ConeBarStacked) && (chartType != ExcelChartType.ConeBarStacked100Percent))) && (((chartType != ExcelChartType.ConeColumn3D) && (chartType != ExcelChartType.PyramidColumnClustered)) && ((chartType != ExcelChartType.PyramidColumnStacked) && (chartType != ExcelChartType.PyramidColumnStacked100Percent)))) && (((chartType != ExcelChartType.PyramidBarClustered) && (chartType != ExcelChartType.PyramidBarStacked)) && ((chartType != ExcelChartType.PyramidBarStacked100Percent) && (chartType != ExcelChartType.PyramidColumn3D))))) { throw new ArgumentException("The specified chart type is not compitible with Bar 3D chart", "chartType"); } this.ChartType = chartType; this.VaryColors = false; this.GapDepth = 150; this.GapWidth = 150; }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelBubbleChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> public ExcelBubbleChart(ExcelChartType chartType) { this.bubbleScale = 100; if ((chartType == ExcelChartType.Bubble) || (chartType == ExcelChartType.Bubble3D)) { this.ChartType = chartType; this.SizeRepresents = BubbleSizeRepresents.Area; this.ShowNegativeBubbles = false; this.BubbleScale = 100; this.VaryColors = true; } }
private string GetBarDirection(ExcelChartType chartType) { if (((chartType == ExcelChartType.ColumnClustered) || (chartType == ExcelChartType.ColumnStacked)) || (chartType == ExcelChartType.ColumnStacked100Percent)) { return("col"); } if (((chartType != ExcelChartType.BarClustered) && (chartType != ExcelChartType.BarStacked)) && (chartType != ExcelChartType.BarStacked100Percent)) { return("col"); } return("bar"); }
/// <summary> /// Initializes a new instance of the <see cref="T:Dt.Xls.Chart.ExcelOfPieChart" /> class. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <exception cref="T:System.ArgumentException">The specified chart type is not compitible with pie of pie or bar of pie chart.;chartType</exception> public ExcelOfPieChart(ExcelChartType chartType) { this.gapWidth = 150; this.secondPieSize = 0x4b; if ((chartType != ExcelChartType.PieOfPie) && (chartType != ExcelChartType.BarOfPie)) { throw new ArgumentException("The specified chart type is not compitible with pie of pie or bar of pie chart.", "chartType"); } this.ChartType = chartType; this.VaryColors = true; this.GapWidth = 150; this.SecondPieSize = 0x4b; this.SplitType = OfPieChartSplitType.Auto; }
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); }
private string GetBarGrouping(ExcelChartType chartType) { if ((chartType == ExcelChartType.BarClustered) || (chartType == ExcelChartType.ColumnClustered)) { return("clustered"); } if ((chartType == ExcelChartType.ColumnStacked) || (chartType == ExcelChartType.BarStacked)) { return("stacked"); } if ((chartType != ExcelChartType.BarStacked100Percent) && (chartType != ExcelChartType.ColumnStacked100Percent)) { return("clustered"); } return("percentStacked"); }
private string GetBarGrouping(ExcelChartType chartType) { if ((((chartType == ExcelChartType.BarClustered3D) || (chartType == ExcelChartType.ColumnClustered3D)) || ((chartType == ExcelChartType.PyramidBarClustered) || (chartType == ExcelChartType.PyramidColumnClustered))) || (((chartType == ExcelChartType.ConeColumnClustered) || (chartType == ExcelChartType.ConeBarClustered)) || ((chartType == ExcelChartType.CylinderBarClustered) || (chartType == ExcelChartType.CylinderColumnClustered)))) { return("clustered"); } if ((((chartType == ExcelChartType.ColumnStacked3D) || (chartType == ExcelChartType.BarStacked3D)) || ((chartType == ExcelChartType.PyramidBarStacked) || (chartType == ExcelChartType.PyramidColumnStacked))) || (((chartType == ExcelChartType.ConeBarStacked) || (chartType == ExcelChartType.ConeColumnStacked)) || ((chartType == ExcelChartType.CylinderBarStacked) || (chartType == ExcelChartType.CylinderColumnStacked)))) { return("stacked"); } if ((((chartType == ExcelChartType.BarStacked100Percent3D) || (chartType == ExcelChartType.ColumnStacked100Percent3D)) || ((chartType == ExcelChartType.PyramidColumnStacked100Percent) || (chartType == ExcelChartType.PyramidBarStacked100Percent))) || (((chartType == ExcelChartType.ConeColumnStacked100Percent) || (chartType == ExcelChartType.ConeBarStacked100Percent)) || ((chartType == ExcelChartType.CylinderColumnStacked100Percent) || (chartType == ExcelChartType.CylinderBarStacked100Percent)))) { return("percentStacked"); } if (((chartType != ExcelChartType.Column3D) && (chartType != ExcelChartType.CylinderColumn3D)) && ((chartType != ExcelChartType.PyramidColumn3D) && (chartType != ExcelChartType.ConeColumn3D))) { return("clustered"); } return("standard"); }
/// <summary> /// Adds the chart. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <param name="chartName">Name of the chart.</param> /// <param name="fromRow">From row.</param> /// <param name="fromColumn">From column.</param> /// <param name="toRow">To row.</param> /// <param name="toColumn">To column.</param> /// <returns></returns> /// <exception cref="T:System.NotSupportedException"></exception> /// <exception cref="T:System.ArgumentOutOfRangeException">fromRow</exception> public IExcelChart AddChart(ExcelChartType chartType, string chartName, int fromRow, int fromColumn, int toRow, int toColumn) { if (string.IsNullOrWhiteSpace(chartName)) { throw new NotSupportedException(ResourceHelper.GetResourceString("EmptyChartNameError")); } using (List <IExcelChart> .Enumerator enumerator = this.ExcelCharts.GetEnumerator()) { while (enumerator.MoveNext()) { if (enumerator.Current.Name == chartName) { throw new NotSupportedException(ResourceHelper.GetResourceString("CurrentWorksheetHasSameChartError")); } } } if (fromRow < 0) { throw new ArgumentOutOfRangeException("fromRow"); } if (toRow >= this.RowCount) { throw new ArgumentOutOfRangeException("toRow"); } if (fromColumn < 0) { throw new ArgumentOutOfRangeException("fromColumn"); } if (toColumn >= this.ColumnCount) { throw new ArgumentOutOfRangeException("toColumn"); } IExcelChart chart = ChartFactory.GetChart(chartType); chart.Anchor = new TwoCellAnchor(fromRow, fromColumn, toRow, toColumn); chart.Name = chartName; this.ExcelCharts.Add(chart); return(chart); }
private static string GetChartNodeTextByChartType(ExcelChartType chartType) { switch (chartType) { case ExcelChartType.Area3D: case ExcelChartType.AreaStacked3D: case ExcelChartType.AreaStacked1003D: return "area3DChart"; case ExcelChartType.Area: case ExcelChartType.AreaStacked: case ExcelChartType.AreaStacked100: return "areaChart"; case ExcelChartType.BarClustered: case ExcelChartType.BarStacked: case ExcelChartType.BarStacked100: case ExcelChartType.ColumnClustered: case ExcelChartType.ColumnStacked: case ExcelChartType.ColumnStacked100: return "barChart"; case ExcelChartType.BarClustered3D: case ExcelChartType.BarStacked3D: case ExcelChartType.BarStacked1003D: case ExcelChartType.ColumnClustered3D: case ExcelChartType.ColumnStacked3D: case ExcelChartType.ColumnStacked1003D: case ExcelChartType.ConeBarClustered: case ExcelChartType.ConeBarStacked: case ExcelChartType.ConeBarStacked100: case ExcelChartType.ConeCol: case ExcelChartType.ConeColClustered: case ExcelChartType.ConeColStacked: case ExcelChartType.ConeColStacked100: case ExcelChartType.CylinderBarClustered: case ExcelChartType.CylinderBarStacked: case ExcelChartType.CylinderBarStacked100: case ExcelChartType.CylinderCol: case ExcelChartType.CylinderColClustered: case ExcelChartType.CylinderColStacked: case ExcelChartType.CylinderColStacked100: case ExcelChartType.PyramidBarClustered: case ExcelChartType.PyramidBarStacked: case ExcelChartType.PyramidBarStacked100: case ExcelChartType.PyramidCol: case ExcelChartType.PyramidColClustered: case ExcelChartType.PyramidColStacked: case ExcelChartType.PyramidColStacked100: return "bar3DChart"; case ExcelChartType.Bubble: return "bubbleChart"; case ExcelChartType.Doughnut: case ExcelChartType.DoughnutExploded: return "doughnutChart"; case ExcelChartType.Line: case ExcelChartType.LineMarkers: case ExcelChartType.LineMarkersStacked: case ExcelChartType.LineMarkersStacked100: case ExcelChartType.LineStacked: case ExcelChartType.LineStacked100: return "lineChart"; case ExcelChartType.Line3D: return "line3DChart"; case ExcelChartType.Pie: case ExcelChartType.PieExploded: return "pieChart"; case ExcelChartType.BarOfPie: case ExcelChartType.PieOfPie: return "ofPieChart"; case ExcelChartType.Pie3D: case ExcelChartType.PieExploded3D: return "pie3DChart"; case ExcelChartType.Radar: case ExcelChartType.RadarFilled: case ExcelChartType.RadarMarkers: return "radarChart"; case ExcelChartType.XYScatter: case ExcelChartType.XYScatterLines: case ExcelChartType.XYScatterLinesNoMarkers: case ExcelChartType.XYScatterSmooth: case ExcelChartType.XYScatterSmoothNoMarkers: return "scatterChart"; case ExcelChartType.Surface: return "surfaceChart"; case ExcelChartType.StockHLC: return "stockChart"; default: throw new NotImplementedException("没有实现的图表类型"); } }
public static ExcelChart CreateChart(ExcelChartType chartType,string chartName, WorkSheet worksheet) { switch (chartType) { case ExcelChartType.Pie: case ExcelChartType.PieExploded: case ExcelChartType.Pie3D: case ExcelChartType.PieExploded3D: return new ExcelPieChart(chartName,chartType, worksheet); case ExcelChartType.BarOfPie: case ExcelChartType.PieOfPie: return new ExcelOfPieChart(chartName, chartType, worksheet); case ExcelChartType.Doughnut: case ExcelChartType.DoughnutExploded: return new ExcelDoughnutChart(chartName, chartType, worksheet); case ExcelChartType.BarClustered: case ExcelChartType.BarStacked: case ExcelChartType.BarStacked100: case ExcelChartType.BarClustered3D: case ExcelChartType.BarStacked3D: case ExcelChartType.BarStacked1003D: case ExcelChartType.ConeBarClustered: case ExcelChartType.ConeBarStacked: case ExcelChartType.ConeBarStacked100: case ExcelChartType.CylinderBarClustered: case ExcelChartType.CylinderBarStacked: case ExcelChartType.CylinderBarStacked100: case ExcelChartType.PyramidBarClustered: case ExcelChartType.PyramidBarStacked: case ExcelChartType.PyramidBarStacked100: case ExcelChartType.ColumnClustered: case ExcelChartType.ColumnStacked: case ExcelChartType.ColumnStacked100: case ExcelChartType.Column3D: case ExcelChartType.ColumnClustered3D: case ExcelChartType.ColumnStacked3D: case ExcelChartType.ColumnStacked1003D: case ExcelChartType.ConeCol: case ExcelChartType.ConeColClustered: case ExcelChartType.ConeColStacked: case ExcelChartType.ConeColStacked100: case ExcelChartType.CylinderCol: case ExcelChartType.CylinderColClustered: case ExcelChartType.CylinderColStacked: case ExcelChartType.CylinderColStacked100: case ExcelChartType.PyramidCol: case ExcelChartType.PyramidColClustered: case ExcelChartType.PyramidColStacked: case ExcelChartType.PyramidColStacked100: return new ExcelBarChart(chartName, chartType, worksheet); case ExcelChartType.XYScatter: case ExcelChartType.XYScatterLines: case ExcelChartType.XYScatterLinesNoMarkers: case ExcelChartType.XYScatterSmooth: case ExcelChartType.XYScatterSmoothNoMarkers: return new ExcelScatterChart(chartName,chartType, worksheet); case ExcelChartType.Line: case ExcelChartType.Line3D: case ExcelChartType.LineMarkers: case ExcelChartType.LineMarkersStacked: case ExcelChartType.LineMarkersStacked100: case ExcelChartType.LineStacked: case ExcelChartType.LineStacked100: return new ExcelLineChart(chartName, chartType, worksheet); default: return new ExcelChart(chartName,chartType, worksheet); } }
/// <summary> /// Gets the chart. /// </summary> /// <param name="chartType">Type of the chart.</param> /// <returns></returns> internal static IExcelChart GetChart(ExcelChartType chartType) { ExcelChart chart = new ExcelChart(); switch (chartType) { case ExcelChartType.ColumnClustered: case ExcelChartType.ColumnStacked: case ExcelChartType.ColumnStacked100Percent: case ExcelChartType.BarClustered: case ExcelChartType.BarStacked: case ExcelChartType.BarStacked100Percent: chart.BarChart = new ExcelBarChart(chartType); return(chart); case ExcelChartType.ColumnClustered3D: case ExcelChartType.ColumnStacked3D: case ExcelChartType.ColumnStacked100Percent3D: case ExcelChartType.Column3D: case ExcelChartType.BarClustered3D: case ExcelChartType.BarStacked3D: case ExcelChartType.BarStacked100Percent3D: chart.Bar3DChart = new ExcelBar3DChart(chartType); return(chart); case ExcelChartType.Line: case ExcelChartType.LineWithMarkers: case ExcelChartType.LineStacked: case ExcelChartType.LineStackedWithMarkers: case ExcelChartType.LineStacked100Percent: case ExcelChartType.LineStacked100PercentWithMarkers: chart.LineChart = new ExcelLineChart(chartType); return(chart); case ExcelChartType.Line3D: chart.Line3DChart = new ExcelLine3DChart(); return(chart); case ExcelChartType.Pie: case ExcelChartType.ExplodedPie: chart.PieChart = new ExcelPieChart(chartType); return(chart); case ExcelChartType.Pie3D: case ExcelChartType.ExplodedPie3D: chart.Pie3DChart = new ExcelPie3DChart(chartType); return(chart); case ExcelChartType.PieOfPie: case ExcelChartType.BarOfPie: chart.OfPieChart = new ExcelOfPieChart(chartType); return(chart); case ExcelChartType.Scatter: case ExcelChartType.ScatterLines: case ExcelChartType.ScatterLinesWithMarkers: case ExcelChartType.ScatterLinesSmooth: case ExcelChartType.ScatterLinesSmoothWithMarkers: chart.ScatterChart = new ExcelScatterChart(chartType); return(chart); case ExcelChartType.Area: case ExcelChartType.AreaStacked: case ExcelChartType.AreaStacked100Percent: chart.AreaChart = new ExcelAreaChart(chartType); return(chart); case ExcelChartType.Area3D: case ExcelChartType.AreaStacked3D: case ExcelChartType.AreaStacked100Percent3D: chart.Area3DChart = new ExcelArea3DChart(chartType); return(chart); case ExcelChartType.Doughunt: case ExcelChartType.DoughuntExploded: chart.DoughnutChart = new ExcelDoughnutChart(chartType); return(chart); case ExcelChartType.Radar: case ExcelChartType.RadarWithMarkers: case ExcelChartType.FilledRadar: chart.RadarChart = new ExcelRadarChart(chartType); return(chart); case ExcelChartType.Surface: case ExcelChartType.SurfaceWireFrame: chart.Surface3DChart = new ExcelSurface3DChart(chartType); return(chart); case ExcelChartType.SurfaceViewedAbove: case ExcelChartType.SurfaceViewedAboveWireFrame: chart.SurfaceChart = new ExcelSurfaceChart(chartType); return(chart); case ExcelChartType.Bubble: case ExcelChartType.Bubble3D: chart.BubbleChart = new ExcelBubbleChart(chartType); return(chart); case ExcelChartType.StockHighLowClose: case ExcelChartType.StockOpenHighLowClose: chart.StockChart = new ExcelStockChart(chartType); return(chart); case ExcelChartType.CylinderColumnClustered: case ExcelChartType.CylinderColumnStacked: case ExcelChartType.CylinderColumnStacked100Percent: case ExcelChartType.CylinderBarClustered: case ExcelChartType.CylinderBarStacked: case ExcelChartType.CylinderBarStacked100Percent: case ExcelChartType.CylinderColumn3D: case ExcelChartType.ConeColumnClustered: case ExcelChartType.ConeColumnStacked: case ExcelChartType.ConeColumnStacked100Percent: case ExcelChartType.ConeBarClustered: case ExcelChartType.ConeBarStacked: case ExcelChartType.ConeBarStacked100Percent: case ExcelChartType.ConeColumn3D: case ExcelChartType.PyramidColumnClustered: case ExcelChartType.PyramidColumnStacked: case ExcelChartType.PyramidColumnStacked100Percent: case ExcelChartType.PyramidBarClustered: case ExcelChartType.PyramidBarStacked: case ExcelChartType.PyramidBarStacked100Percent: case ExcelChartType.PyramidColumn3D: chart.Bar3DChart = new ExcelBar3DChart(chartType); return(chart); } return(chart); }
public static void GenChart(IChartShape ct, object[] x, object[] y, string name, ExcelChartType type) { var s = ct.Series.Add(name, type); s.EnteredDirectlyValues = y; s.EnteredDirectlyCategoryLabels = x; }
public static ExcelChart CreateChart(ExcelChartType chartType, string chartName, WorkSheet worksheet) { switch (chartType) { case ExcelChartType.Pie: case ExcelChartType.PieExploded: case ExcelChartType.Pie3D: case ExcelChartType.PieExploded3D: return(new ExcelPieChart(chartName, chartType, worksheet)); case ExcelChartType.BarOfPie: case ExcelChartType.PieOfPie: return(new ExcelOfPieChart(chartName, chartType, worksheet)); case ExcelChartType.Doughnut: case ExcelChartType.DoughnutExploded: return(new ExcelDoughnutChart(chartName, chartType, worksheet)); case ExcelChartType.BarClustered: case ExcelChartType.BarStacked: case ExcelChartType.BarStacked100: case ExcelChartType.BarClustered3D: case ExcelChartType.BarStacked3D: case ExcelChartType.BarStacked1003D: case ExcelChartType.ConeBarClustered: case ExcelChartType.ConeBarStacked: case ExcelChartType.ConeBarStacked100: case ExcelChartType.CylinderBarClustered: case ExcelChartType.CylinderBarStacked: case ExcelChartType.CylinderBarStacked100: case ExcelChartType.PyramidBarClustered: case ExcelChartType.PyramidBarStacked: case ExcelChartType.PyramidBarStacked100: case ExcelChartType.ColumnClustered: case ExcelChartType.ColumnStacked: case ExcelChartType.ColumnStacked100: case ExcelChartType.Column3D: case ExcelChartType.ColumnClustered3D: case ExcelChartType.ColumnStacked3D: case ExcelChartType.ColumnStacked1003D: case ExcelChartType.ConeCol: case ExcelChartType.ConeColClustered: case ExcelChartType.ConeColStacked: case ExcelChartType.ConeColStacked100: case ExcelChartType.CylinderCol: case ExcelChartType.CylinderColClustered: case ExcelChartType.CylinderColStacked: case ExcelChartType.CylinderColStacked100: case ExcelChartType.PyramidCol: case ExcelChartType.PyramidColClustered: case ExcelChartType.PyramidColStacked: case ExcelChartType.PyramidColStacked100: return(new ExcelBarChart(chartName, chartType, worksheet)); case ExcelChartType.XYScatter: case ExcelChartType.XYScatterLines: case ExcelChartType.XYScatterLinesNoMarkers: case ExcelChartType.XYScatterSmooth: case ExcelChartType.XYScatterSmoothNoMarkers: return(new ExcelScatterChart(chartName, chartType, worksheet)); case ExcelChartType.Line: case ExcelChartType.Line3D: case ExcelChartType.LineMarkers: case ExcelChartType.LineMarkersStacked: case ExcelChartType.LineMarkersStacked100: case ExcelChartType.LineStacked: case ExcelChartType.LineStacked100: return(new ExcelLineChart(chartName, chartType, worksheet)); default: return(new ExcelChart(chartName, chartType, worksheet)); } }
public ExcelChart(string chartName, ExcelChartType type, WorkSheet wroksheet) : base(wroksheet) { this.ChartType = type; this.Name = chartName; }
public ExcelLineChart(string chartName, ExcelChartType type, WorkSheet wroksheet) : base(chartName, type, wroksheet) { }
public ExcelPieChart(string chartName, ExcelChartType type, WorkSheet wroksheet, Uri drawUri, string rId) : base(chartName, type, wroksheet) { this.DrawingUri = drawUri; this.RelationshipID = rId; }