ContributionsMost RecentNewest TopicsMost LikesSolutionsRe: Change Axis labels on Line Chart Easy fix! Thanks a ton, this worked like a charm. Change Axis labels on Line Chart I have a couple dashboards with month numbers instead of month names as the x-axis labels, and I modify the numbers to month names with the following script. It works when I am editing the widget, but in my dashboard it works very briefly then goes back to showing numbers. widget.on('domready', function(widget,args){ var monthDict = { 1: 'Jan', 2: 'Feb', 3: 'Mar', 4: 'Apr', 5: 'May', 6: 'Jun', 7: 'Jul', 8: 'Aug', 9: 'Sep', 10: 'Oct', 11: 'Nov', 12: 'Dec' } widget.queryResult.xAxis = { categories: widget.queryResult.xAxis.categories, //Runs every value in the category through this function labels: { formatter: function () { return monthDict[this.value] } } } }) I suspect it could be tied to our tabber widget we use as each of these charts are on a different tab. The tabber widget uses the following script. Is what is causing this issue that they both use 'on render' actions and how could I get around it? Thanks! /* Welcome to your Widget's Script. To learn how you can access the Widget and Dashboard objects, see the online documentation at https://sisense.dev/guides/js/extensions */ let awarenessDict = { header: "6320975ac5f4330037f5e20e", vis_per_week: "6320967dc5f4330037f5e205", avg_usr_top: "63330ec1c5f4330037f5f5cf", tot_pg_views: "63346af4c5f4330037f5f759", pg_views_by_usr_type: "63346ac3c5f4330037f5f757", home_pg_views: "63497108c5f4330037f608b1", lesson_pg_views: "6349710fc5f4330037f608b3" }; let acquisitionDict = { header: "63209795c5f4330037f5e210", new_regs: "63209d90c5f4330037f5e220", new_prem_subs: "6320bf31c5f4330037f5e23e", anon_to_reg_to_sub_conv: "63333ba7c5f4330037f5f637", tot_reg_by_ref: "63333763c5f4330037f5f5eb", tot_regs: "63333794c5f4330037f5f5ed" }; let engagementDict = { header: "632097a1c5f4330037f5e212", trials_w_prem_act: "63224911c5f4330037f5eaf7", perc_prem_usr_act_cont: "632a3794c5f4330037f5f1a7", trial_usr_sched_adop: "63348834c5f4330037f5f79c", perc_trial_w_sched: "6334886cc5f4330037f5f79e", perc_prem_act_notes_and_vid: "633ef370c5f4330037f5ff81", perc_prem_act_notes_and_vid_and_other: "634495f3c5f4330037f60480", perc_prem_act_combined: "63449704c5f4330037f604a5" }; let valueDict = { header: "632097a5c5f4330037f5e214", upsell_subscribers: "633f3fecc5f4330037f6016b", upsell_subscribers_perc: "633f4015c5f4330037f6016f", avg_sub_val: "6345c90ac5f4330037f605ee" }; let retentionDict = { header: "632097a9c5f4330037f5e216", new_trials_by_ret_status: "63209dc1c5f4330037f5e222", sub_net_churn_monthly: "63458007c5f4330037f604ae", sub_net_churn_ytd: "634581f0c5f4330037f604b2", avg_sub_len_trial_vs_non: "633ef4c8c5f4330037f5ff8d", churn_monthly: "634ee562c5f4330037f60c13", churn_perc_monthly: "634ee5a4c5f4330037f60c17" }; let awarenessDictArray = Object.values(awarenessDict); let acquisitionDictArray = Object.values(acquisitionDict); let engagementDictArray = Object.values(engagementDict); let valueDictArray = Object.values(valueDict); let retentionDictArray = Object.values(retentionDict); let awarenessDictHideArray = acquisitionDictArray.concat(engagementDictArray, valueDictArray, retentionDictArray); let acquisitionDictHideArray = awarenessDictArray.concat(engagementDictArray, valueDictArray, retentionDictArray); let engagementDictHideArray = awarenessDictArray.concat(acquisitionDictArray, valueDictArray, retentionDictArray); let valueDictHideArray = awarenessDictArray.concat(acquisitionDictArray, engagementDictArray, retentionDictArray); let retentionDictHideArray = awarenessDictArray.concat(acquisitionDictArray, engagementDictArray, valueDictArray); widget.on('render',function(w, e){e.prefixText = ''; e.suffixText = ''; e.selectedColor = '#0074e6'; /*The color of the chosen title*/ e.fontColor = '#7f8d9a'; /*The color of the unchosen titles*/ e.elementWidth = '103%'; e.descColor = '#a5a5a5'; e.parentMarginLeft = '-15px'; e.height = 32; /* affects the tabber widget default high*/ }); widget.tabs = [{title: "Awareness", displayWidgetIds : awarenessDictArray, hideWidgetIds : awarenessDictHideArray}, {title: "Conversion", displayWidgetIds : acquisitionDictArray, hideWidgetIds : acquisitionDictHideArray}, {title: "Engagement", displayWidgetIds : engagementDictArray, hideWidgetIds : engagementDictHideArray}, {title: "Value", displayWidgetIds : valueDictArray, hideWidgetIds : valueDictHideArray}, {title: "Retention", displayWidgetIds : retentionDictArray, hideWidgetIds : retentionDictHideArray} ]; SolvedMax Rows in a table widget Hello, I can't find it in the documentation anywhere, is there a maximum number of rows of data a table widget can have? We have one that is only showing about half the expected results and I am curious if we are hitting a max rows of some kind causing the issue. TIA Conditional Formatting Break By Chart I am trying to use the script listed here, but it only partially works. The sorting works, but the color changes do not seem to stick beyond the initial refresh. Is this script outdated or do I need to change something about it? I am on a Linux install of Sisense hosted by Sisense if that helps. https://support.sisense.com/kb/en/article/conditional-formatting-break-by-chart Working with datetime objects Hello, I was wondering if there were good resources for working with datetime objects in the same field as opposed to separating them out into two fields date and time. Like for example, if I have a datetime field and I want to set it as a filter for all results that took place before x datetime (Rather than before x date and y time) how would I go about doing that? Also how do I get Sisense to display datetime objects in a single field rather than trying to split them out without using something like Javascript. Here are a couple things we would like to be able to do with datetime objects that I have not found an easy way to do. Filter on all objects that took place before a specific datetime rather than before a specific date and before a specific time Display datetime in a table/pivot without having to convert to unix timestamp or a string then use javascript Do timezone conversions or even set up a filter for converting from UTC to whatever the desired timezone is. I saw the solution to convert the datetime object into unix time then use javascript to convert it in the dashboard, but that doesn't work as some of our table results are very large and the users are exporting them. I also don't really like the solution of converting it to a string because then we lose the ability to treat it as a date for filters, sorting, and such. I would really like to treat it as a datetime object if that is possible, so any resources around the ability to do that would be greatly appreciated. Thanks for the help! Re: Pivot 2.0 Javascript resizing strangely Works like a charm, thanks! Pivot 2.0 Javascript resizing strangely Hello, I have used the following javascript before to modify results within a column of a pivot table, but when I try to do the same for column table objects I get strange behavior. Here is the javascript I use to modify the pivot table. widget.on('ready', function(){ $('[class*="--row-1"] div.table-grid__content__inner').map(function(i, cell) { switch (cell.innerHTML ) { case "1": cell.innerHTML='January'; break; case "2": cell.innerHTML='February'; break; case "3": cell.innerHTML='March'; break; case "4": cell.innerHTML='April'; break; case "5": cell.innerHTML='May'; break; case "6": cell.innerHTML='June'; break; case "7": cell.innerHTML='July'; break; case "8": cell.innerHTML='August'; break; case "9": cell.innerHTML='September'; break; case "10": cell.innerHTML='October'; break; case "11": cell.innerHTML='November'; break; case "12": cell.innerHTML='December'; break; } }); }) This is the resulting table. If after the widget loads I can click as if I wanted to change the sorting and the table refreshes and looks correct. After doing that it looks as follows. I am certain it is a simple problem, but was wondering if anyone could help me identify it. Thanks Thanks! SolvedRe: How to apply javascript to all pages of a table It is running on Linux, Sisense hosted. Also this is a table widget type object, not a pivot2 object if that helps. Re: Use of Conditions in BloX We took your script and modified it for what we are doing and it got us taken care of and opened quite a few doors for us across the board. Thanks a ton for your reply. How to apply javascript to all pages of a table I have the following script that modifies the values within a couple columns in this table widget and it works just fine. The issue I am having is it only applies to the first page of the table, and as soon as I change the page the changes are no longer applied. Is there an event associated with changing pages of a table I can set up in the script to make sure it runs when pages are changed? Thanks in advance. widget.on('domready', function(se, ev) { var tableObject = document.getElementById("grid"); for (var r = 1, n = tableObject.rows.length; r < n; r++) { if (tableObject.rows[r].cells[5].innerHTML == 1){ tableObject.rows[r].cells[5].innerHTML = "True"; } else{ tableObject.rows[r].cells[5].innerHTML = "False"; }; if (tableObject.rows[r].cells[6].innerHTML == 1){ tableObject.rows[r].cells[6].innerHTML = "True"; } else{ tableObject.rows[r].cells[6].innerHTML = "False"; } }; });