cancel
Showing results for 
Search instead for 
Did you mean: 

Font colour on graphs

Kins
8 - Cloud Apps
8 - Cloud Apps

Hi All,

Is there a way to change the font colour on graphs? Our branding uses some dark colours and so ideally we'd like the font colour to be white in some instances.

Many thanks,

3 REPLIES 3

keerthan
8 - Cloud Apps
8 - Cloud Apps

Hi Kins,

Yes we change the font color of any graphs through widget script. Could you please provide a screenshot of the graph ?

Thanks & Regards

Keerthan

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @Kins ,

Here is an example of changing Font color for Line/Bar/Column/Pie/Area charts

https://www.binextlevel.com/post/change-background-and-font-color-of-widgets-in-sisense

-Hari

do you have a way of colouring the specific label value. By default a lot of widgets are dark blue with black text.

I have tried this: https://community.sisense.com/t5/build-analytics/dynamically-formatted-data-labels/m-p/1838#M223 but the

 

$.each(ev.result.series, function(index, value){
value.dataLabels = {
backgroundColor: value.color,
color: 'white',
padding: 5,
borderRadius: 5

The color part doesnt ever seem to work.

 

For Example my Script is:


//Formatting datalabels 
widget.on('processresult', function(se,ev){
	
	$.each(ev.result.series, function(index, value){
		value.dataLabels = {
									backgroundColor: value.color,
									color: '#FFFFFF',
									padding: 5,
									borderRadius: 5
								}
	
	})
	
})

//Adjusting position of datalabels
widget.on('domready', function(se,ev){
	
	barWidth = $('.highcharts-series-group .highcharts-series rect', element).width()
	
	$('.highcharts-data-labels .highcharts-label', element).each(function(){
		labelWidth = $(this).find('rect').width()
		labelHeight = $(this).find('rect').height()
		$(this).find('rect').attr('width', barWidth)
		$(this).find('rect').attr('height', labelHeight - 5)
		$(this).find('rect').attr('x', ((labelWidth - barWidth)/2))
	
	})

});

But my output looks like this:
Screenshot_91.png

Community Toolbox

Recommended quick links to assist you in optimizing your community experience:

Developers Group:

Product Feedback Forum:

Need additional support?:

Submit a Support Request

The Legal Stuff

Have a question about the Sisense Community?

Email [email protected]