cancel
Showing results for 
Search instead for 
Did you mean: 

Selectively change Markers on a Line Graph

TheLivingBubba
8 - Cloud Apps
8 - Cloud Apps

I have a stakeholder who would like to selectively turn off the markers on line graphs for certain lines.
As in the attached image, they want to remove the markers on the dashed lines, but keep them for the solid line. I can't find anything in the documentation that addresses this & the Markers slider only allows an all or none approach.

Thanks for any advice that may be offered!

1 ACCEPTED SOLUTION

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @TheLivingBubba ,

We can achieve it using script. Enable markers and use the script below to disable markers for the specified series (lines). Update the 'seriesWithoutMarkers' variable with the list of series names for which markers need to be removed.

widget.on('processresult', function(se, args){	
	 
	const seriesWithoutMarkers = ['Total Revenue', 'Profit'];
	
	args.result.series.forEach(s => {
		if(seriesWithoutMarkers.includes(s.name)) {
			s.data.forEach(item => {
				item.marker.enabled = false;
			})
		}
	})
	
})

Result:

harikm007_0-1741673694307.png

Please let me know if that's working correctly.

-Hari

View solution in original post

3 REPLIES 3

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @TheLivingBubba ,

We can achieve it using script. Enable markers and use the script below to disable markers for the specified series (lines). Update the 'seriesWithoutMarkers' variable with the list of series names for which markers need to be removed.

widget.on('processresult', function(se, args){	
	 
	const seriesWithoutMarkers = ['Total Revenue', 'Profit'];
	
	args.result.series.forEach(s => {
		if(seriesWithoutMarkers.includes(s.name)) {
			s.data.forEach(item => {
				item.marker.enabled = false;
			})
		}
	})
	
})

Result:

harikm007_0-1741673694307.png

Please let me know if that's working correctly.

-Hari

TheLivingBubba
8 - Cloud Apps
8 - Cloud Apps

@harikm007 - Thank you so much! I genuinely appreciate your time on this.

TheLivingBubba
8 - Cloud Apps
8 - Cloud Apps

Just to follow up & confirm that this works perfectly - thank you so much!