Edits to script for changing widget values by buttons
Summary: NancySummit is seeking help with modifying a script to change widget values in a line chart without using an indicator widget. They are facing an issue where buttons do not show the selected color. Assaf Hanina suggests that the script should work with line charts as is, without adjustment, and asks for more details about the display issue to assist further. The discussion includes an exchange of replies and clarifications.
I followed the instructions in this post... https://community.sisense.com/t5/knowledge-base/changing-measures-in-the-entire-dashboard-using-blox-user/tac-p/26261#M3953
It works great but I've been trying to modify this to work on a line chart (widget.type == 'lineChart' in the SwitchMeasure action) -- I don't want an indicator widget on the dashboard -- and I just can't get it to work without including an indicator widget. The line chart changes between 3 values perfectly without the indicator widget type but the buttons won't show the designated selected color when I click on them w/out the indicator widget in the dashboard. Anyone have some ideas? My javascript is beginner level if that. Thanks for any help!
NancySummit
OP1 year agoThanks so much!!
NancySummit
OP1 year agoWow that works great!! And much simpler. Thank you so much! Now I need know if I can show TWO measures at one time on a chart -- like Revenue AND Profit in your example. I'm guessing that needs to be a separate post? Thanks again!!
Assaf Hanina
·1 year ago · EditedHey NancySummit ,
I'm happy to hear it's resolve the issue!
You can specify 2 measures in the same chart.
The blox action will replace the first measure as it hard-coded for (Item[0])
In case needed, you may consider duplicating the action with different name and set hard coded to item[1] for replacing the secondary measure if needed.
Here is an example with secondary measure: Selecting the Revenue
Selecting the Quantity
Best Regards
NancySummit
OP1 year agoWell, as SOON as I posted that reply to you it occurred to me to edit the line chart widget script and change all instances of widget.metadata.panels[0].items[0].jaql.title == to widget.metadata.panels[1].items[0].jaql.title == and it looks like that fixed it... The buttons are correctly cycling through the colors. Does that sound correct to you? That the target widget panels[] needs to be adjusted to the type of widget it is? Thank you!
Assaf Hanina
·1 year ago · EditedHey NancySummit ,
Thanks for sharing the feedback.
Please find a dash file with possible solution and related action.
Example
Hope this will resolve the issue
Best regards