top of page

Apply conditional colors to Markers in Sisense Line chart

Yes! Its possible to apply different colors to line chart markers based on its value.


Here is the script for this


widget.on('processresult', function(se, ev){
	$.each(ev.result.series[0].data, function(index, value){

		if(value.y <= 5000){
			value.marker.lineColor = '#206902'
			value.color = '#206902'
			value.marker.states.hover.lineColor = '#206902'
			value.marker.states.select.lineColor = '#206902'
			
		}
		else if(value.y <= 10000){
			value.marker.lineColor = '#56c229'
			value.color = '#56c229'
			value.marker.states.hover.lineColor = '#56c229'
			value.marker.states.select.lineColor = '#56c229'
			
		}
		else if(value.y <= 15000){
			value.marker.lineColor = '#5cfa19'
			value.color = '#5cfa19'
			value.marker.states.hover.lineColor = '#5cfa19'
			value.marker.states.select.lineColor = '#5cfa19'
			
		}
		else if(value.y <= 20000){
			value.marker.lineColor = '#ff4f4f'
			value.color = '#ff4f4f'
			value.marker.states.hover.lineColor = '#ff4f4f'
			value.marker.states.select.lineColor = '#ff4f4f'
			
		}
		else{
			value.marker.lineColor = '#ed2b34'
			value.color = '#ed2b34'
			value.marker.states.hover.lineColor = '#ed2b34'
			value.marker.states.select.lineColor = '#ed2b34'
		}

	})
	
})

155 views0 comments

Recent Posts

See All
bottom of page