Build 3.5.0.61 of xlsgen adds support for all the 48 built-in chart styles for XLSX files.
The 48 built-in chart styles, supported in xlsgenNumbering goes from left to right, and top to bottom. The first row of chart styles are flat styles. The next row has a shadow and white borders for every slice of the pie. The next row has a shadow and that's it. The next row has bevels for every slice of the pie. The next row is flat and has thin borders for every slice of the pie. And finally the last row has bevels for every slice of the pie and a black background.
In fact, white and black colors are Windows system foreground and background colors, respectively. So the user experience may be different.
How it works in
xlsgen is quite simple. Here is a piece of code in C++ for a creating a pie chart with the 14-th chart style :
C++ code |
xlsgen::IXlsWorksheetPtr wksht001 = workbook->AddWorksheet( L"Sheet1" );
// make sure to disable modern themes workbook->Theme = xlsgen::workbooktheme_classic;
xlsgen::IXlsChartPtr chart001s0 = wksht001->NewChart(xlsgen::charttype_pie2D, 5, 2, 20, 9);
// pick the 14-th style ([1..48]) chart001s0->CustomProperties->ChartStyle = 14;
xlsgen::IXlsChartDynamicDataSourcePtr datasource001s0 = chart001s0->DynamicDataSource;
xlsgen::IXlsChartDynamicDataSourceSeriesPtr serie001s0ss0 = datasource001s0->AddSerie(); serie001s0ss0->SeriesValuesFormula = L"={2;5;4}"; chart001s0->SurfaceArea->Options->Patterns->Area->Type = xlsgen::chartareatype_custom; chart001s0->SurfaceArea->Options->Patterns->Area->Pattern->PatternStyle = xlsgen::chartareapattern_solid; chart001s0->SurfaceArea->Options->Patterns->Area->Pattern->BackgroundColor = 0xB4DDE7; chart001s0->PlotArea->Options->Patterns->Borders->Type = xlsgen::chartbordertype_none; chart001s0->PlotArea->Options->Patterns->Area->Type = xlsgen::chartareatype_none; chart001s0->CustomProperties->PieExplodedSliceDistance = 0; chart001s0->Legend->Show = xlsgen::chartlegend_right; chart001s0->SeriesByIndex[1]->DataElements[2]->PieExplodedSliceDistance = 12;
|