private static ExcelAreaChart AddAreaWithColor(ExcelWorksheet ws, eAreaChartType type, string name, int row, int col, ePresetChartStyle style, ePresetChartColors colors, Action <ExcelAreaChart> SetProperties) { var chart = ws.Drawings.AddAreaChart(name, type); chart.SetPosition(row, 0, col, 0); chart.To.Column = col + 12; chart.To.ColumnOff = 0; chart.To.Row = row + 18; chart.To.RowOff = 0; var serie = chart.Series.Add("D2:D8", "A2:A8"); SetProperties(chart); chart.StyleManager.SetChartStyle(style, colors); return(chart); }
/// <summary> /// Adds a new area chart to the worksheet. /// </summary> /// <param name="Name"></param> /// <param name="ChartType">Type of chart</param> /// <param name="PivotTableSource">The pivottable source for a pivotchart</param> /// <returns>The chart</returns> public ExcelAreaChart AddAreaChart(string Name, eAreaChartType ChartType, ExcelPivotTable PivotTableSource) { return((ExcelAreaChart)AddChart(Name, (eChartType)ChartType, PivotTableSource)); }
/// <summary> /// Add a new area chart to the worksheet. /// </summary> /// <param name="Name"></param> /// <param name="ChartType">Type of linechart</param> /// <returns>The chart</returns> public ExcelAreaChart AddAreaChart(string Name, eAreaChartType ChartType) { return((ExcelAreaChart)AddChart(Name, (eChartType)ChartType, null)); }
/// <summary> /// Adds a new area chart to the chart /// </summary> /// <param name="chartType">The type of the new chart</param> /// <returns>The chart</returns> public ExcelAreaChart AddAreaChart(eAreaChartType chartType) { return((ExcelAreaChart)Add((eChartType)chartType)); }
private static void Area3DStyle(ExcelWorksheet ws, eAreaChartType chartType) { //Style 1 AddAreaWithColor(ws, chartType, "ColorStyleColorfulPalette1", 0, 5, ePresetChartStyle.Area3dChartStyle1, ePresetChartColors.ColorfulPalette1, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 2 AddAreaWithColor(ws, chartType, "ColorStyleColorfulPalette2", 0, 18, ePresetChartStyle.Area3dChartStyle2, ePresetChartColors.ColorfulPalette2, c => { c.Legend.Position = eLegendPosition.Top; }); //Style 3 AddAreaWithColor(ws, chartType, "ColorStyleColorfulPalette3", 0, 31, ePresetChartStyle.Area3dChartStyle3, ePresetChartColors.ColorfulPalette3, c => { }); //Style 4 AddAreaWithColor(ws, chartType, "ColorStyleColorfulPalette4", 22, 5, ePresetChartStyle.Area3dChartStyle4, ePresetChartColors.ColorfulPalette4, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 5 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette1", 22, 18, ePresetChartStyle.Area3dChartStyle5, ePresetChartColors.MonochromaticPalette1, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 6 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette2", 22, 31, ePresetChartStyle.Area3dChartStyle6, ePresetChartColors.MonochromaticPalette2, c => { }); //Style 7 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette3", 44, 5, ePresetChartStyle.Area3dChartStyle7, ePresetChartColors.MonochromaticPalette3, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 8 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette4", 44, 18, ePresetChartStyle.Area3dChartStyle8, ePresetChartColors.MonochromaticPalette4, c => { }); //Style 9 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette5", 44, 31, ePresetChartStyle.Area3dChartStyle9, ePresetChartColors.MonochromaticPalette5, c => { }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette6", 66, 5, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette6, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette7", 66, 18, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette7, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette8", 66, 31, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette8, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette9", 88, 5, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette9, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette10", 88, 18, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette10, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette11", 88, 31, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette11, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette12", 110, 5, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette12, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 10 AddAreaWithColor(ws, chartType, "ColorStyleMonochromaticPalette13", 110, 18, ePresetChartStyle.Area3dChartStyle10, ePresetChartColors.MonochromaticPalette13, c => { c.Legend.Position = eLegendPosition.Bottom; }); }
private static void AreaStyle(ExcelWorksheet ws, eAreaChartType chartType) { //Style 1 AddArea(ws, chartType, "AreaChartStyle1", 0, 5, ePresetChartStyle.AreaChartStyle1, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 2 AddArea(ws, chartType, "AreaChartStyle2", 0, 18, ePresetChartStyle.AreaChartStyle2, c => { c.Legend.Position = eLegendPosition.Top; }); //Style 3 AddArea(ws, chartType, "AreaChartStyle3", 0, 31, ePresetChartStyle.AreaChartStyle3, c => { }); //Style 4 AddArea(ws, chartType, "AreaChartStyle4", 22, 5, ePresetChartStyle.AreaChartStyle4, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 5 AddArea(ws, chartType, "AreaChartStyle5", 22, 18, ePresetChartStyle.AreaChartStyle5, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 6 AddArea(ws, chartType, "AreaChartStyle6", 22, 31, ePresetChartStyle.AreaChartStyle6, c => { }); //Style 7 AddArea(ws, chartType, "AreaChartStyle7", 44, 5, ePresetChartStyle.AreaChartStyle7, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 8 AddArea(ws, chartType, "AreaChartStyle8", 44, 18, ePresetChartStyle.AreaChartStyle8, c => { c.Legend.Position = eLegendPosition.Top; }); //Style 9 AddArea(ws, chartType, "AreaChartStyle9", 44, 31, ePresetChartStyle.AreaChartStyle9, c => { c.Legend.Remove(); }); //Style 10 AddArea(ws, chartType, "AreaChartStyle10", 66, 5, ePresetChartStyle.AreaChartStyle10, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 11 AddArea(ws, chartType, "AreaChartStyle11", 66, 18, ePresetChartStyle.AreaChartStyle11, c => { }); }