Change an SVG color in BloX with criteria based on token - and for it to work with the carousel
Hello, my aim is to have a bar grow (change width, seems to be working fine) and change color based on if it exceeds a threshold. The issue is that the threshold will be client dependent. I have this script that works as intended for the initial display with static thresholds, but I want to replace the "parseInt('80')" and "parseInt('65')" in the script with tokens like "{panel:Threshold Good}" and "{panel:Threshold Meh}". It also fails to display the conditional color when I cycle on the carousel. Any assistance would be appreciated! { "style": ".conditional-bar-good{fill:#006100; stroke:#006100} .conditional-bar-meh{fill:#9C6500; stroke:#9C6500} .conditional-bar-bad{fill:#9C0006; stroke:#9C0006} .conditional-bar-na{fill:#000000; stroke:#000000}", "script": "$(document).ready(function(){let barClass = document.getElementById('conditional-bar');let cbw = parseInt(barClass.getAttribute('width'));if(cbw >=parseInt('80')){barClass.className.baseVal = 'conditional-bar-good';}else if(cbw>=parseInt('65')){barClass.className.baseVal = 'conditional-bar-meh';}else{barClass.className.baseVal = 'conditional-bar-bad';};});", "title": "", "showCarousel": true, "body": [ { "type": "Container", "items": [ { "type": "TextBlock", "horizontalAlignment": "center", "spacing": "small", "text": "<svg width='80%' height='25'> <rect width='100%' height=100% rx='15' style='fill:#C6EFCE;stroke-width:1;stroke:#006100' /> <rect width='{panel:Threshold Good}%' height='100%' rx='15' style='fill:#FFEB9C;stroke-width:1;stroke:#9C6500' /> <rect width='{panel: Threshold Meh}%' height='100%' rx='15' style='fill:#FFC7CE;stroke-width:1;stroke:#9C0006' /> <rect id='conditional-bar' class='conditional-bar-na' y='20%' width='{panel:Value 1}%' height='60%' rx='10' style='fill-opacity: 0.7;stroke-width:3;' /></svg>" } ] }, { "spacing": "none", "type": "Container", "items": [ { "spacing": "none", "type": "TextBlock", "class": "condition_data", "text": "{panel:Label 1}", "horizontalAlignment": "center", "size": "medium", "weight": "bold" }, { "spacing": "none", "type": "TextBlock", "class": "condition_data", "text": "{panel:Value 1}%", "horizontalAlignment": "center", "size": "large", "weight": "bold" } ] } ], "actions": [] }76Views0likes4CommentsHow to make Switchable Dimension with Radio Buttons
Hi harikm007 DRay I am trying to create a radio button switcable dimensional changer and wanted to see if it can be done with Radio Buttons, my current script is: { "title": "", "style": "", "script": "", "showCarousel": true, "body": [ { "type": "Input.ChoiceSet", "id": "radiotVal", "displayType": "expanded", "layout": "horizontal", "isMultiSelect": false, "value": "1", "choices": [ { "title": "Total Revenue", "value": "1" }, { "title": "Total Quantity", "value": "2" } ] } ], "events": [ { "type": "valueChanged", "elementId": "radiotVal", "actions": [ { "type": "SwitchMeasure", "title": "DEBUG: event fires?", "script": "console.log('[BloX] valueChanged fired, selectVal=', {{radiotVal.value}}); alert('Radio changed to ' + {{radiotVal.value}});" } ] } ], "actions": [] } The radio buttons show up but they do not switch the measures for the widgets I targeted. I am also okay with not specifically targeting widgets but affecting all the widgets on the dashboard. This is the script for the action: var dimIndex = payload.data.selectVal - 1; var dimToSwapTo = payload.widget.metadata.panels[1].items[dimIndex].jaql; var widgetIds = payload.data.widgetToModify; payload.widget.dashboard.widgets.$$widgets .filter(i => widgetIds.includes(i.oid)) .forEach(function (widget) { if (widget.metadata.panels[1].$$widget.type == 'indicator') { widget.metadata.panels[0].items[0].jaql = dimToSwapTo; } else { widget.metadata.panels[1].items[0].jaql = dimToSwapTo; } widget.changesMade('plugin-BloX', 'metadata'); widget.refresh(); }) I am not sure if this is the correct Action script since this is used from: https://community.sisense.com/kb/blox/changing-measures-in-the-entire-dashboard-using-blox-user-interface/8802Solved91Views0likes6CommentsQuerying Model in Text Widgets?
Hi DRay Liliia_DevX Is it possible to query your model in a text widget to display a value? For example say I have a text widget that says Total Revenue: {Total Revenue} this part coming from your model? I know this can be achieved in BloX but BloX does not work with Compose SDK so I am trying to see if this works in a text widget.Solved90Views1like5CommentsHide Widget Using Web Access Token
We have an embedded dashboard that utilizes web access token for filtering on different organizations. We have a widget that only needs to be displayed to certain organizations. Does anyone know if we can filter individual widgets using the web access tokens?Solved3KViews1like6CommentsTabber Widget
I am attempting to connect a tabber widget to my data. The Sisense documentation on Tabber is from 2019 and appears to be out of date. It says that it is a plug in and needs to be downloaded and installed. On my end it appears in the drop down for widget options automatically. The outdated Sisense documentation also says that it can only be used once per dashboard. I am working on recreating an existing dashboard that uses it several times. I added the tabber widget and edited the script to have the two tabber fields names, and the IDs for the two widgets that Id like to "tabber" between (show and hide). I am not sure how to connect the two widgets to the tabber widget. Thank you.2KViews1like1CommentAutomated Widget Titles
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.1KViews0likes3CommentsDYNAMIC EMAIL REPORT SETTINGS
Hi Sisense Community! Please reference the screenshot below referenced in the following questions when configuring a dashboard's email settings: Is there a script to only export the active/visible widgets based on the Tabber selection? Is there a script/way to automatically run this for each location shown in the selected filter? So this would deliver 7 separate emails to the subscriber's inbox - one for each of the 7 locations. The Directors currently go into this report and filter locations one by one to then export & email a copy to the appropriate building manager. I'm looking for a way to remove that step and have it sent directly to the Director's inbox who can forward it from there. Note* the managers do not have access to Sisense otherwise I would have them just subscribe directly. Thanks! -Carter3.4KViews0likes4CommentsDisabling user accounts rather than deleting
Hi, Is it possible to deactivate user accounts rather than completing removing? We have users that will no longer have access to the system, but could come back later (for example, trail users). Is using the security model to deny access the only other way? This would still add against our user license count so not an ideal solution long term.Solved2KViews0likes2CommentsSisense Iframe embedded feature - I want to pass the parameters for the filter dynamically.
In my case, I have GetUserAuditReport Store Procedure with the param UserId. Based on this SP I need to create a table view in sisense. I need to embed this into my application. In this case, how can I achieve this? I going to embed only a widget table based on filtration.1.2KViews0likes1Comment