cancel
Showing results for 
Search instead for 
Did you mean: 

Line Chart - Line Conditional Formatting

Ophir_Buchman
Sisense Team Member
Sisense Team Member

When creating a line chart, you might want it to color differently for values below the threshold.

Add the following script to your widget:

widget.on('processresult', function(widget, result) {
let dataSeries = result.result.series[0];
let threshold = 0;
let aboveColor = '#0000ff'
let belowColor = '#ff0000'

dataSeries.threshold = threshold;
dataSeries.color = aboveColor;
dataSeries.negativeColor = belowColor
})
Before After
Ophir_Buchman_0-1651215608626.png Ophir_Buchman_1-1651215624773.png
0 REPLIES 0