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'
		}

	})
	
})

Commentaires

Noté 0 étoile sur 5.
Pas encore de note

Ajouter une note
BI Next Level white logo

BI Next Level is your trusted resource for BI customization, data solutions, and expert insights. Explore practical tips, scripts, and tutorials for tools like Sisense, Python, and SQL. Let’s transform your data into impactful insights together.

Quick Links
Connect with us
Copyright © 2024. All Rights Reserved. Designed, Developed & Maintained  by Intertoons
bottom of page