Forum Discussion

TheLivingBubba's avatar
TheLivingBubba
Cloud Apps
03-10-2025
Solved

Selectively change Markers on a Line Graph

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...
  • harikm007's avatar
    03-11-2025

    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:

    Please let me know if that's working correctly.

    -Hari