The Measure Changer Widget
Download: Measure Changer
Introduction
Dimension Changer Widget Plugin allows the user to display several values on one widget with easy values switching on the same chart visualization.
The purpose is to display several related values in one chart in a simple and easy way.
The Dimension Changer Widget Plugin can be used in Column Chart, Pie Chart, Bar Chart, Line Chart and Pivot.
Important: The Dimension Changer Widget Plugin does not support ranking filter (Top x).
The Dimension Changer Widget Plugin works on V5.7. and up.
Example
In this example we choose 3 values to switch between in the Dimension Changer Widget Plugin.
Above we see the Dimension Changer Widget and below we see the Column chart it affects.
The data presentation in the chart below changes according to the value chosen in the Dimension Changer Widget above. You can see the chosen value marked in green.
In this example we see that clicking on a value changes the data visualization in the graph - from Total revenues to Total Quantity.
Steps
In order to add the Dimension Changer Widget Plugin to affect a chart, please follow the listed steps below:
Step 1:
Download and extract the enclosed folder into the plugins folder:
C:\Program Files\Sisense\PrismWeb\plugins\DimensionChanger, if the "plugins" folder is not there, please create it. If you are using version 7.2 and higher unzip the contents into your C:\Program Files\Sisense\app\plugins\ folder.
Step 2:
Create a Column Chart/ Bar Chart/ Line Chart/ Pivot.
The Dimension Changer Widget Plugin supports more than one chart value (but affects only one).
Step 3:
Create a Dimension Changer
For Charts:
Put the values you wish to display and change between them under value.
The first value will appear first in the chart. Leave Rows empty.
For Pivots:
Put the rows you wish to display and change between them under rows.
The first row will appear first in the chart. Leave Values empty.
Save the widget.
Step 4:
Refresh the Widget and click apply
The chart should appear with the Plot Line chosen and configuration.
Attached is an example for a dashboard with Dimension Changer Widget Plugin. (connects to Sample Ecommerce data).
DimentionChangerPlugin.dash
Release Notes:
January 09, 2018 - the plugin was updated with the following:
- Fixed widget not working in V6.7 and V7 in some scenarios
- Fixed In export to PDF layout of widgets distorted
- Added robust configuration via design pane
June 23, 2020 - the plugin was updated with the following:
- Fixed plugin.json manifest to support Sisense v8.2
- Updated readme with script samples
-
Official comment
I have a workaround to help people use this plugin in newer Sisense versions - the following works for our team on 8.2, at least!
(1) Take Weinan Sun's suggestion in an earlier comment and change the text
"pluginInfraVersion": 2to
"version": 2
in the config JSON file for the widget.
For us, (1) was enough to get *old* Dimension Changers to work; (2)-(5) are for creating new Dimension Changers.
(2) When creating a new Dimension Changer, select / edit the dimensions you want to switch between as usual.
(3) Even though you can't select "Widgets to Add" in the user interface, you can do the same thing with a widget script. Open the Dimension Changer's widget script and enter the code below:widget.on('ready', function(w, args) {
//define widgetsToAdd as an array ( in [] ) containing one object (the part in {})
//for each widget you want to be affected by the dimension changer; objects
//should be comma-separated for when you want to affect multiple widgets.
var widgetsToAdd = [
{
'id': 'oidexample', //change to OID of widget to be affected here, e.g '5ehz679st8911a2920430783'
'panelToChange': 'panelName', //change to appropriate panel name, like 'X-Axis' or 'Values'
'index': 0
}
];
args.widget.style.selectedWidgets = widgetsToAdd;
});(4) Save the widget's script and reload the dashboard.
(5) Test the dimension changer; it should work as expected.
I hope this helps, at least until the plugin is updated for Sisense 8!Comment actions -
Hi Inbal,
a very nice plugin. I've question regarding code modification, on the attached screenshot you can see that the whole widget is offset to the left and this does not look to nice. I had the same problem with Tabber but there you can change that offset. Would it be possible here as well?
Regards,
Michał
1.png -
Hi Konstantinos,
Thank you for your comment.
Regarding your questions:
1.The Dimension Changer Widget Plugin can be used in Column Chart, Bar Chart and Line Chart. And you can only choose one. We have a Tabber Plugin that can be used on Different Widgets but you cannot change the value (It switches between existing widgets).2. In the current context you cannot use the Measure Changer to affect more than one value
Beat Regards,
Inbal
-
Hi Inbal, excellent plugin, but could you please clarify Konstantinos' question on affecting more than one widget at a time?
ie, not the type of widgets, rather how do you add multiple Widget IDs to the script? (assuming the same values are accessible on each of the widgets).
I would like user to select "Gross Income" or "Net Income" and that switch the values on the 3 or 4 widgets immediately below to show dimension. Currently, I think I would require 3 separate switchers.
-
All, FYI you can get the changer to affect multiple widgets by adding their IDs into the string.
However, Inbal - could you please advise how I get it to equally update/switch a single dimensioned Indicator? Same value, same name? Doesn't seem to work.
ie
e.widgetIds = [
{id:'55a7b4c6b6e6a3b826000017', panelToChange:'values', index:0} ,{id:'6667b4c6b6e6a3b826000017', panelToChange:'values', index:0}
]; -
Hi!
To leverage this plugin and change the breakby instead of the value use the following script.
* panel to change is case sensitive
Enjoy!
Ramon J Lopez
widget.on('render',function(w,e){
e.prefixText = 'Break By - ';
e.widgetIds = [
{
id:'580139775fe8975c36000017',
panelToChange:'break by',
index:0
}
]; }); -
Hi David,
Yes, it is possible. Just change the following code in the script:
e.widgetIds = [ {id:'55a7b4c6b6e6a3b826000017', panelToChange:'values', index:0} // for pivot insert 'rows', for charts insert 'values' ];
To this:
e.widgetIds = [ {id: w.oid, panelToChange:'values', index:0} // for pivot insert 'rows', for charts insert 'values' ];
Regards,
Omer
-
Is there any particular reason why this can't work for line charts when using paneltochange equal to 'rows' instead of 'values'? The comment in the script implies that 'rows' vs 'values' is intended for specific widget types, but I'd love to be able to change the dimension (i.e. 'row') for my line chart. My use case is a simple end-user click to switch from date to week to month time granularity in the chart. Simply setting paneltochange as 'rows' didn't work. Is there any way to support changing dimensions (not meaures nor break-bys) for line charts?
-
Well, fiddling around I ended up solving my issue. For those curious, 'rows' is the name reserved for pivot dimensions, whereas 'x-axis' is for line charts and 'categories' is for column/bar chart dimensions. Like this:
e.widgetIds = [
{ id:'58cbfd4aeaf4ef00000000ad', panelToChange:'categories', index:0
} ];So, it seems obvious now but I take it that the panelToChange is hard-coded to the element label within the widget's configuration. Perhaps the instructions could be clearer about this?
-
Hi Inbal,
Nice plugin, thank you. I'm trying to use it with a Pivot table and I would like it to affect the second row (dimension) in the pivot table. I can't seem to get this to work. I would like the second row of the pivot table to change between two different dimensions. Is there a way to accomplish this? Thank you.
Rolf
-
Hi guys,
This is a great plugin!
One thing bothers me: everytime the screen size changes (e.g., if I unhide the filters bar, or If I change my browser to full screen mode), the target widget reloads and changes to the first dimension/measure of the list. This obviously consumes server resources unnecessarily.
Do you know how to change this behaviour?
Thanks!
-
Hi all,
Please note that we've made a few fixes to the plugin. You can go ahead and download the latest version. Here is what was fixed:
- Fixed widget not working in V6.7 and V7 in some scenarios
- Fixed In export to PDF layout of widgets distorted
- Added robust configuration via design pane
You can also find those and further update details in the release notes at the bottom of this post.
Let us know what you think.
Thanks,
Oxana
-
Hi everybody,
I'm trying to use this widget but it doesn't seem to work.
I can see it in the list of possible widgets: I choose it, and then add to the values just the columns that I'm interested in.
Then I go into the edit script and I paste in the code (just for this picture I changed the widget's code, but the code is correct
And then, after saving the script and applying the modifications... nothing works.
As you can see nothing shows up.
The code refers to this widget:
I'm using Sisense 6.7, and when I try the example dashboard, it works fine, so it shouldn't be a problem of corrupt plugin or something similar...
Any hints on what could be wrong?
Thanks a lot
Giovanni
Please sign in to leave a comment.
Comments
67 comments