SpreadJS Documentation
setSparkline Method
The row index.
The column index.
The data range.
The data orientation.
The sparkline type.
The sparkline setting.
The date axis range.
The date axis range orientation.
Sets the sparkline for a cell.
Syntax
var instance = new GcSpread.Sheets.Sheet(name);
var value; // Type: Sparkline
value = instance.setSparkline(row,
                              col,
                              dataRange,
                              dataOrientation,
                              sparklineType,
                              sparklineSetting,
                              dateAxisRange,
                              dateAxisOrientation);
function setSparkline( 
   row : number,
   col : number,
   dataRange : Range,
   dataOrientation : DataOrientation,
   sparklineType : SparklineType,
   sparklineSetting : SparklineSetting,
   dateAxisRange : Range,
   dateAxisOrientation : DataOrientation
) : Sparkline;

Parameters

row
The row index.
col
The column index.
dataRange
The data range.
dataOrientation
The data orientation.
sparklineType
The sparkline type.
sparklineSetting
The sparkline setting.
dateAxisRange
The date axis range.
dateAxisOrientation
The date axis range orientation.

Return Value

The sparkline.
Example
This example creates a sparkline for the specified range.
var data = new GcSpread.Sheets.Range(1, 0, 8, 1);
var setting = new GcSpread.Sheets.SparklineSetting();
setting.showMarkers(true);
setting.lineWeight = 3;
setting.displayXAxis = true;
setting.showFirst(true);
setting.showLast(true);
setting.showLow(true);
setting.showHigh(true);
setting.showNegative(true);

setting.seriesColor('Text 2 1');
setting.firstMarkerColor('Text 2 3');
setting.negativeColor('Accent 2 1');
setting.markersColor('Accent 3 1');
setting.lowMarkerColor('Accent 4 1');
setting.highMarkerColor('Accent 6 1');
setting.lastMarkerColor('Accent 6 6');
setting.axisColor('Text 1 1');

sheet.addSpan(13, 0, 4, 3, null);

sheet.setSparkline(13, 0, data, GcSpread.Sheets.DataOrientation.Vertical, GcSpread.Sheets.SparklineType.line, setting);

sheet.setValue(1, 0, 1);
sheet.setValue(2, 0, -2);
sheet.setValue(3, 0, -1);
sheet.setValue(4, 0, 6);
sheet.setValue(5, 0, 4);
sheet.setValue(6, 0, -4);
sheet.setValue(7, 0, 3);
sheet.setValue(8, 0, 8);
See Also

Reference

Sheet type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.