Build 3.5.0.19 of xlsgen adds native support for sparklines in the object model so anyone can create, modify and delete sparklines introduced in Excel 2010.
native support for sparklines in xlsgenSparklines in Excel have the following features :
- attached to a range of data
- is either straight lines, columns, or plus-minus columns (otherwise known as win-loss columns)
- can have custom color elements (values, negative values, axis, markers, first value, last value, maximum value, minimum value)
- can stress one or more specific points (markers, maximum, minimum, first value, last value, negative values)
- can have a custom line weight for sparklines made of straight lines
- can have a custom date axis (defined by a range)
- can have custom minimum and maximum values
- can render empty or invisible data in cells differently
(C# code)
worksheet.set_Number(6,3, 13);
worksheet.set_Number(7,3 24);
worksheet.set_Number(8,3, 15);
worksheet.set_Number(9,3, 17);
worksheet.set_Number(10,3, 19);
// new sparkline (straight lines)IXlsSparkline sp = worksheet.Sparklines.Add(enumSparklineType.sparklinetype_line);
IXlsSparklineElement sp_data = sp0.Add();
sp_data.DataAsRange(6,3,10,3);
// row1, col1, row2, col2sp_data.LocationRow = 11;
sp_data.LocationColumn = 3;
// formattingsp.ShowMaximumValue = true;
sp.set_SparklineColor(enumSparklineElement.sparklineelement_values, 0xFF0000);