Forum Discussion

zohebakber's avatar
zohebakber
Cloud Apps
01-25-2023
Solved

Font color change

Hi team,  I want to change the text styling of the widget in bar and scatter chart. I am using the below script. It works fine for me however, I am unable to change the color of the font here. ...
  • harikm007's avatar
    01-25-2023

    Hi zohebakber ,

    Try this script:

     

    widget.on('ready', function(se, ev){
    	_.each($("text", element), function(label){ 
    	label.style="font-size: 13px; font-family: sans-serif; font-weight: bold";
    
    	})
    	$('.sis-scope .slf-widget-text-primary').css('fill', 'blue')//to change text color
    })
    

     

    If you want to change color of value labels only, use this:

     

    widget.on('processresult', function(se, ev){
    
    	$.each(ev.result.series, function(seriesIndex, seriesValue){
    		
    			seriesValue.dataLabels = {
    										style: {
    											
    											color:'red'
    										}
    			}
    
    	})
    	ev.result.yAxis[0].stackLabels.style.color = 'green'
    })

    Refer: https://www.binextlevel.com/post/format-data-labels

     

    -Hari