harikm007
07-15-2022Data Warehouse
Add description to Widget
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
Steps:
-
Create widget
-
Add below script to widget.
-
Update text to be displayed and set format of text
-
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
-Hari