The Smart Label
Download: Smart Label
Introduction
The following article describes steps needed to add to create smart text widget to present ElastiCube fields as text.
For example - present the selected Country on the upper part of the dashboard:
Implementaion Steps
-
Extract the folder in the attached zip file into \...\Sisense\PrismWeb\plugins. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder.
-
Create new widget and chose the smart label icon from the list:
-
Choose a field to present, set a design and hit "Apply":
[Please note, that in case you have multiple values, it will present the first one. Therefore, it is always better to change the type of the filter to single value only, like in the given example]
*****UPDATE October 30th, 2015: Script now supports more than one column in the "Rows" category displaying the contents as a list *****
*****UPDATE March 25th, 2016: Updated to support display of multiple rows AND multiple selection on the filters *****
*****UPDATE April 27th, 2016: Updated to display "All" when there is no filter selection, instead of listing out every member *****
*****UPDATE May 13th, 2016: Updated the script to resolve an issue of a "None" text displayed instead of the value****
*****UPDATE June 2nd, 2016: Updated the script to resolve an issue with date formatting not being passed through, as well as an issue with NOT filters****
*****UPDATE July 5th, 2016: Updated to work with Sisense v6.4
*****UPDATE Aug 15th, 2016: Plugin updated with minor issues fixes
*****UPDATE Feb 3rd, 2017: Plugin updated to work with dependent filters
*****UPDATE Mar 8th, 2017: Plugin updated to work with widget filter. Design options for Labels and Multiple Values work as expected.
*****UPDATE May 23rd, 2017: Plugin updated to work with dependent filters.
*****UPDATE June 12th, 2017: Plugin updated to work on 6.6.1 and support back compatibility with previous versions of the plugin.
*****UPDATE August 13th, 2018: Plugin updated: Widget's style menu offers background and text colors, as well as vertical alignment.
Download previous version from March 8th, 2017
-
Official comment
This plug in works on Version: L8.0.5.156. Only drop the plug in folder contained in the download folder into the plug ins folder in Sisense.
Comment actions -
Dynamic dashboard title??
I'm trying to create a dashboard title that is dynamic, for example "Dave's Dashboard" or "Mary's Dashboard" based on the user running it (that's just an example.)
I haven't seen this plugin used in that way. Does anyone know if it's possible or if there is alternate code to do it?
Thank you!
-
Can smart labels be used within existing widgets? For example (see screenshot), rather than writing "Last Month" and "Prior Month" in an indicator widget, I'd love to simply write "October" and "September" based dynamically on the report run date. I'm guessing I can pull the run date from session variables but even if so, not sure how I could overwrite the values titles. Thanks in advance!
-
@David Burke
You can't use the smart label within other widgets BUT:
- If you want to have a smart label above a KPI widget that says the current month - you can hack it via the Cube by simply creating a dummy custom table with one field and one value that's equal to today's month and then use it in the Smart Label
- OR, Sisense released a really cool widget that's called BloX, perfect for KPIs and spot on to what you're looking to achieve. Open the link below to read more
https://www.sisense.com/marketplace/blox-widgets/
Feel free to touch base if you need some help (:
-
Using Sisense 6.4 and this plugin is working fine. However, if I have 2 filters on the dashboard and one is dependent of another, then this widget shows no data. Is it possible to have this plugin work for dependent filters as well? Ultimately, my users will have a set of dependent filters like Brand->Category, and then a 3rd filter, say Month, that is not dependent. We would like all 3 of these filters to be able to be displayed in the widget.
-
Dear all,
How can we limit the number of values displayed by this plugin?
The use case is: As long as a dashboard-level filter set to display one or few items - it just works fine;
Once a user (possibly, unconsciously or by accident) hits "select all" - the plugin returns ALL values - which is entire column and it will cause a huge query (entire column) - will freeze the dashboard for a long while
Dow do I eliminate this usecase/scenario?
Is that any patch that can limit number of selected items?
Thank you!
-
I've downloaded the newest version of the Smart Label plugin from 8/13 and it seems like the previous update from 4/27/2016 where the plugin is supposed to display "ALL" if the filter is set to include all does not work. Instead, I always see the full list of items in the list. I am on version 7.1 but I believe the "All" functionality didn't work on 6.7 either. I would use this widget a lot more if the "All" selected functionality actually worked correctly.
Another QA note: when editing the widget, the list of values is actually labeled "test" instead of "Values".
Minor formatting request: I want to be able to make the category name bold or something so that it's easier to see the distinction between the category name and the selected values. It also helps draw the user's eye to this information, which is usually important for understanding what data they are looking at.
Ex. Selected Group: Northern Region, Southern Region
-
EDIT:
I found a better way:
widget.on('initialized', function(w){
w.title = prism.user.firstName + ' yay';
});ORIGINAL COMMENT:
David,
You could add a widget script like:
jQuery.get('/api/users/loggedIn',function(user){
prism.activeWidget.title= user.firstName + ' custom text';
});Check out the network tab of the console to see everything returned from /users/loggedIn
-
Hi @Hila Kantor, can I get access to download the latest version of smart label? The one at the link : https://support.sisense.com/hc/article_attachments/115015548547/smartLabelWidget_08Jun17.zip gives me an error saying " widget is not registered". This error is intermittent.
-
Brian,
The script below will allow you to format multiple elements of the SmartLabel. Just comment out or remove the tags you don't need. I hope it is helpful.
//FORMAT SMARTLABEL
widget.on('ready', function(se, ev){
$(element).css('background-color','#CE1127');//changes the widget's background
$(element).css('color','#3a77d8'); //text color
$(element).css('font-weight','bold'); //font style
$('widget-header' ,element.parent()).css('background-color','#CE1127'); //changes the widget's title background
})
Regards, Jim Thomas
-
Thanks Jim
Closing the loop, Katie was able to update the script for me:
/* Bolds the category label in SmartLabel Widget */
widget.on('ready', function(se, ev){
$('span.smartLabelRowTitle',element).css('font-weight','bold'); //font style
})
Also, I wanted to add leading between the categories but not between lines (i.e. create paragraphs, not just double-space. This let me do that:
$('div.smartLabelRow',element).css('margin-bottom','14px');
-
Hi Stefan.... Try the following code
widget.on('ready', function(se, ev){
$(element).css('background-color','#CE1127');//changes the widget's background
$(element).css('color','white'); //text color
$(element).css('font-weight','bold'); //font style
$('widget-header' ,element.parent()).css('background-color','#CE1127'); //changes the widget's title background
}) -
Is it possible to format dates through custom javascript? It seems that the date formatting option doesn't work with this plugin.
sisense_smartlabel_format.png
Please sign in to leave a comment.
Comments
109 comments