cancel
Showing results for 
Search instead for 
Did you mean: 

Line Chart - Line Conditional Formatting

Ophir_Buchman
12 - Data Integration
12 - Data Integration

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
1 REPLY 1

rvickersevotix
9 - Travel Pro
9 - Travel Pro

Is there a way to make the threshold one of the panels in my line chart?

I have a bar chart and a target line, I want to colour the bar based on the target line.