cancel
Showing results for 
Search instead for 
Did you mean: 

Automated Widget Titles

Camantea
8 - Cloud Apps
8 - Cloud Apps

Hi All,

I am wondering if anyone has had any success in automating the title of a widget within a dash using the widget script. I am trying to have the title update the month automatically when a filter is applied. For example, trying to show "November Sales Trend" and have this title update when a new filter for the month of sale is selected. I found the below script would work for adjusting the title, but just need the script to grab the Current Month now.


widget.on('ready', function(w,e){
prism.activeWidget.title= 'November Venue Sales' /* this changes the title
})

Thanks in advance for any suggestions!

3 REPLIES 3

HamzaJ
12 - Data Integration
12 - Data Integration

Hey @Camantea ,

I am using the following script to achieve that. I think you need to adjust it a little bit to suit your needs:

widget.on('ready', function(w,e){ 
var currentDate = new Date();
var date = currentDate.getDate();
var month = currentDate.getMonth(); 
var year = currentDate.getFullYear();
var monthDateYear  = date + "-" + (month+1) + "-" + year;
prism.activeWidget.title='Current Date: ' + monthDateYear;
});

harikm007
13 - Data Warehouse
13 - Data Warehouse

Hi @Camantea ,

Here is a post on how to update widget title based on a filter selected:

https://www.binextlevel.com/post/dynamic-widget-title-and-axis-label

 

Thanks,

Hari

 

wallingfordce
10 - ETL
10 - ETL

Hi, I'd like to do something similar based on which value has been enabled. This is on a line chart with multiple values and a break by. Unfortunately, the Title of the Y-Axis doesn't reflect the name of the enabled value automatically. I'd like to update the Y-Axis Title and the widget title with the title of the enabled value. Can you point me in the right direction? Thanks in advance.