cancel
Showing results for 
Search instead for 
Did you mean: 

Add description to Widget

harikm007
13 - Data Warehouse
13 - Data Warehouse

Here is a method to add detailed information about the chart and data that will always appear at the bottom of a widget.

Refer: https://www.binextlevel.com/post/add-description-to-widget

harikm007_0-1657908270289.png

Steps:

 
  1. Create widget

  2. Add below script to widget.

  3. Update text to be displayed and set format of text

  4. Save the script and refresh widget

 

descriptionSpace = 80

widget.on('processresult',function(se,ev){
	ev.result.chart.spacingBottom = descriptionSpace//to add required space to display description at bottom
})

//Bottom description
widget.on('domready', function(w, args){
	text = 'This is a description. This is a description. This is a description. This is a description. This is a description. This is a description. This is a description. This is a description. This is a description. '
	chart = w.chart[0][Object.keys(w.chart[0])[0]].hc
	chart.renderer.text(text, 15, chart.chartHeight - descriptionSpace+20)
		.css({
			width: chart.chartWidth-15,
			color: '#a0a0a0',
			'font-style': 'italic'
		  })
		.add();
});

 

 

Also you can add subtitle to a widget: https://www.binextlevel.com/post/add-subtitle-to-widget

harikm007_1-1657908365852.png

-Hari

 

3 REPLIES 3

gwolfe
10 - ETL
10 - ETL

@harikm007 Does this work on the histogram widget? I can't seem to get it to display?

harikm007
13 - Data Warehouse
13 - Data Warehouse

@gwolfe This script works with charts that are created using Highchart libraries. May be the histogram is using some other libraries like d3.

jmn3
9 - Travel Pro
9 - Travel Pro

how can I modify this code to run on a pivot widget?