private static ExcelHistogramChart AddChartEx(ExcelWorksheet ws, ePresetChartStyle style, string name, int row, int col, eChartExType type, Action <ExcelHistogramChart> SetProperties) { var chart = ws.Drawings.AddHistogramChart(name, type == eChartExType.Pareto); chart.SetPosition(row, 0, col, 0); chart.To.Column = col + 12; chart.To.ColumnOff = 0; chart.To.Row = row + 18; chart.To.RowOff = 0; chart.Series.Add("D2:D8", "A2:A8"); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }
private static ExcelSunburstChart AddChartEx(ExcelWorksheet ws, ePresetChartStyle style, string name, int row, int col, Action <ExcelSunburstChart> SetProperties) { var chart = ws.Drawings.AddSunburstChart(name); chart.SetPosition(row, 0, col, 0); chart.To.Column = col + 12; chart.To.ColumnOff = 0; chart.To.Row = row + 18; chart.To.RowOff = 0; chart.Series.Add("D2:D17", "A2:C17"); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }
private static ExcelRegionMapChart AddChart(ExcelWorksheet ws, ePresetChartStyle style, string name, int row, int col, Action <ExcelRegionMapChart> SetProperties) { var chart = ws.Drawings.AddRegionMapChart(name); chart.SetPosition(row, 0, col, 0); chart.To.Column = col + 12; chart.To.ColumnOff = 0; chart.To.Row = row + 18; chart.To.RowOff = 0; chart.Series.Add("A1:B11", "C1:C11"); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }
private static ExcelOfPieChart AddOfPie(ExcelWorksheet ws, eOfPieChartType type, string name, int row, int col, ePresetChartStyle style, Action <ExcelOfPieChart> SetProperties) { var chart = ws.Drawings.AddOfPieChart(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"); serie.DataPoints.Add(0); serie.DataPoints.Add(1); serie.DataPoints.Add(2); serie.DataPoints.Add(3); serie.DataPoints.Add(4); serie.DataPoints.Add(5); serie.DataPoints.Add(6); serie.DataPoints.Add(7); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }
private static ExcelStockChart AddStockChartStyleManager(ExcelWorksheet ws, eStockChartType type, ePresetChartStyle style, string name, int row, int col, ExcelRange range, Action <ExcelStockChart> SetProperties) { var chart = AddStockChart(ws, type, name, row, col, range, SetProperties); chart.StyleManager.SetChartStyle(style); return(chart); }
private static ExcelBarChart AddColumn(ExcelWorksheet ws, eBarChartType type, string name, int row, int col, ePresetChartStyle style, Action <ExcelBarChart> SetProperties) { var chart = ws.Drawings.AddBarChart(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"); var serie2 = chart.Series.Add("B2:B8", "A2:A8"); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }
/// <summary> /// Applies a preset chart style loaded into the StyleLibrary to the chart. /// </summary> /// <param name="style">The preset style to use</param> /// <param name="colors">The preset color scheme to use</param> /// <seealso cref="SetChartStyle(int, int?)"/> public void SetChartStyle(ePresetChartStyle style, ePresetChartColors colors) { SetChartStyle((int)style, (int)colors); }
/// <summary> /// Applies a preset chart style loaded into the StyleLibrary to the chart. /// </summary> /// <param name="style">The style to use</param> /// <seealso cref="SetChartStyle(int, int?)"/> public void SetChartStyle(ePresetChartStyle style) { SetChartStyle((int)style); }
private static ExcelPieChart AddPie(ExcelWorksheet ws, ePieChartType type, string name, int row, int col, ePresetChartStyle style, Action <ExcelPieChart> SetProperties) { var chart = ws.Drawings.AddPieChart(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"); var dp = serie.DataPoints.Add(3); dp.Border.Fill.Style = OfficeOpenXml.Drawing.eFillStyle.SolidFill; dp.Border.Fill.SolidFill.Color.SetRgbColor(Color.Black); SetProperties(chart); chart.StyleManager.SetChartStyle(style); return(chart); }