Ophir_Buchman
04-29-2022Data Integration
Line Chart - Line Conditional Formatting
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 |