Build 4.0.0.78 of xlsgen improves the handling of Excel sparklines in a number of ways :
- sparklines appear in the automatic source code generator, so you can manually create them in Excel and then obtain the corresponding source code in the programming language of your choice. No need to learn the xlsgen object model. Here is an example using VB of a group of 3 sparklines of type column :
Dim sparklineGroup001s1 As IXlsSparkline
Set sparklineGroup001s1 = wksht001.Sparklines.Add(enumSparklineType.sparklinetype_columns)
sparklineGroup001s1.SparklineColor(enumSparklineElement.sparklineelement_values) = RGB(36,65,97)
sparklineGroup001s1.SparklineColor(enumSparklineElement.sparklineelement_markers) = RGB(36,65,97)
sparklineGroup001s1.SparklineColor(enumSparklineElement.sparklineelement_firstvalue) = RGB(149,180,214)
sparklineGroup001s1.SparklineColor(enumSparklineElement.sparklineelement_lastvalue) = RGB(149,180,214)
sparklineGroup001s1.ShowEmptyCellsAs = enumChartInterpolate.chartinterpolate_no
Dim sparklineGroup001s1e0 As IXlsSparklineElement
Set sparklineGroup001s1e0 = sparklineGroup001s1.Add
sparklineGroup001s1e0.LocationRow = 3
sparklineGroup001s1e0.LocationColumn = 8
sparklineGroup001s1e0.DataAsFormula = "Sheet1!D3:G3"
Dim sparklineGroup001s1e1 As IXlsSparklineElement
Set sparklineGroup001s1e1 = sparklineGroup001s1.Add
sparklineGroup001s1e1.LocationRow = 4
sparklineGroup001s1e1.LocationColumn = 8
sparklineGroup001s1e1.DataAsFormula = "Sheet1!D4:G4"
Dim sparklineGroup001s1e2 As IXlsSparklineElement
Set sparklineGroup001s1e2 = sparklineGroup001s1.Add
sparklineGroup001s1e2.LocationRow = 5
sparklineGroup001s1e2.LocationColumn = 8
sparklineGroup001s1e2.DataAsFormula = "Sheet1!D5:G5"
- sparklines are also duplicated in worksheet duplicate scenarios.
- sparklines are also automatically updated when rows or columns are inserted or deleted, in order to reflect the changes.