SpreadJS Documentation
SparklineChanged Event
The sheet that triggered the event.
The sheet's name.
The sparkline whose property has changed.
Occurs when the sparkline has changed.
Syntax
var instance; // Type: Events
instance.SparklineChanged = function(sheet, sheetName, sparkline) { };
SparklineChanged = function ( 
   sheet : Sheet,
   sheetName : string,
   sparkline : Sparkline
) { };

Parameters

sheet
The sheet that triggered the event.
sheetName
The sheet's name.
sparkline
The sparkline whose property has changed.
Example
Removing the sparkline causes a change.
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');
activeSheet.addSpan(13, 0, 4, 3, null);
activeSheet.setSparkline(13, 0, data, GcSpread.Sheets.DataOrientation.Vertical, GcSpread.Sheets.SparklineType.line, setting);
activeSheet.setValue(1, 0, 1);
activeSheet.setValue(2, 0, -2);
activeSheet.setValue(3, 0, -1);
activeSheet.setValue(4, 0, 6);
activeSheet.setValue(5, 0, 4);
activeSheet.setValue(6, 0, -4);
activeSheet.setValue(7, 0, 3);
activeSheet.setValue(8, 0, 8);

// Use IE to see the console log text
$("#spreadContainer").data("spread").getActiveSheet().bind(GcSpread.Sheets.Events.SparklineChanged, function (e, info) {    
console.log("name: " + info.sheetName);  
});

$("#button1").click(function () {
activeSheet.removeSparkline(13, 0);
   });


<input type="button" id="button1" value="button1"/>
See Also

Reference

Events type

 

 


Copyright © GrapeCity, inc. All rights reserved.

Send comments on this topic.