Ejemplo n.º 1
0
 /// <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);
 }
Ejemplo n.º 2
0
        private static ExcelPieChart AddPieWithColor(ExcelWorksheet ws, ePieChartType type, string name, int row, int col, ePresetChartStyle style, ePresetChartColors colors, 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");

            SetProperties(chart);

            chart.StyleManager.SetChartStyle(style, colors);
            return(chart);
        }