private static void RadarLineStyle(ExcelWorksheet ws, eRadarChartType chartType) { //Style 1 AddRadar(ws, chartType, "RadarChartStyle1", 0, 5, ePresetChartStyle.RadarChartStyle1, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 2 AddRadar(ws, chartType, "RadarChartStyle2", 0, 18, ePresetChartStyle.RadarChartStyle2, c => { c.Legend.Position = eLegendPosition.Top; }); //Style 3 AddRadar(ws, chartType, "RadarChartStyle3", 0, 31, ePresetChartStyle.RadarChartStyle3, c => { c.DataLabel.ShowPercent = true; }); //Style 4 AddRadar(ws, chartType, "RadarChartStyle4", 22, 5, ePresetChartStyle.RadarChartStyle4, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 5 AddRadar(ws, chartType, "RadarChartStyle5", 22, 18, ePresetChartStyle.RadarChartStyle5, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 6 AddRadar(ws, chartType, "RadarChartStyle6", 22, 31, ePresetChartStyle.RadarChartStyle6, c => { }); //Style 7 AddRadar(ws, chartType, "RadarChartStyle7", 44, 5, ePresetChartStyle.RadarChartStyle7, c => { c.Legend.Position = eLegendPosition.Bottom; }); //Style 8 AddRadar(ws, chartType, "RadarChartStyle8", 44, 18, ePresetChartStyle.RadarChartStyle8, c => { c.Legend.Position = eLegendPosition.Top; c.DataLabel.ShowPercent = true; }); }
private static ExcelRadarChart AddRadar(ExcelWorksheet ws, eRadarChartType type, string name, int row, int col, ePresetChartStyle style, Action <ExcelRadarChart> SetProperties) { var chart = ws.Drawings.AddRadarChart(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); return(chart); }
/// <summary> /// Adds a new radar 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 ExcelRadarChart AddRadarChart(string Name, eRadarChartType ChartType, ExcelPivotTable PivotTableSource) { return((ExcelRadarChart)AddChart(Name, (eChartType)ChartType, PivotTableSource)); }
/// <summary> /// Adds a new radar chart to the worksheet. /// </summary> /// <param name="Name"></param> /// <param name="ChartType">Type of chart</param> /// <returns>The chart</returns> public ExcelRadarChart AddRadarChart(string Name, eRadarChartType ChartType) { return((ExcelRadarChart)AddChart(Name, (eChartType)ChartType, null)); }
/// <summary> /// Adds a new radar chart to the chart /// </summary> /// <param name="chartType">The type of the new chart</param> /// <returns>The chart</returns> public ExcelRadarChart AddRadarChart(eRadarChartType chartType) { return((ExcelRadarChart)Add((eChartType)chartType)); }