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 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!

  • 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

3 Replies

  • harikm007's avatar
    harikm007
    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:

    Please let me know if that's working correctly.

    -Hari