Data Markers Appearing When Turned Off

Hello All,

I'm still very new to Tessitura and Analytics. I'm having an odd issue with a line chart I'm working on and wanted to check on here for a possible solution.

I have a line chart that shows % to goal per day prior to opening. I was having issues with the line being broken and that issue has been solved with this script: 
widget.on("beforeviewloaded",function(scope, args){
args.options.plotOptions.series.connectNulls = true;
});

The issue I'm running into now are some random data markers on the lines. Markers are turned off in the design panel, but these still appear. I've finally figured out that it is occurring when sales were processed one day but not the day before or after. The script is linking the line, but the underlying data marker is still present. Any recommendations on how to remove this issue? 

Parents
  • Hi Daniel, 

    Yes, using that script, points on the original line that are isolated, single data-points not immediately preceded or followed by another non-null data-point of the x-axis, a marker dot will still be rendered on the line chart:

    Expanding this script, we can iterate through all series lines, and all data points on each line to explicitly remove the marker dots. This will remove the markers as shown below, however, any series with only one data-point in the whole widget will disappear from the chart altogether. This may be a non-issue in your data however.

    widget.on("beforeviewloaded",function(scope, args){
    args.options.plotOptions.series.connectNulls = true;
    });
         
    widget.on('render', function(sender,se){
    for (var i = 0; i < sender.queryResult.series.length; i++ ) {
        for (var j = 0; j < sender.queryResult.series[i].data.length; j++) {
            sender.queryResult.series[i].data[j].marker.enabled = false;
             }
        }
    }
    )

  • I think I know the answer here, but is there a way to duplicate the last value when null instead of just connecting the dots? Connecting them doesn't necessarily paint an accurate picture for my example:

    The blue and purple lines here should really be flat horizontal from weeks 20-30, and jump up in week 31 similar to the black and grey lines. They are connecting in a way that makes it look like they had steady sales during that time. 

  • Hi Gabrielle,

    Would you try replacing the script for that widget with this one? Please update the panelName variable with the exact name of the value in your widget. In my widget I'd named my value "RSUM Total Ticket Count".

    widget.on('processresult', function(se, ev){
         
        var panelName = 'RSUM Total Ticket Count'
         
        var series = ev.result.series.find(el => el.name == panelName)
        var prevValue = series.data[0].y
         
        $.each(series.data, function(index, value){
            if(value.y == null)
                value.y = prevValue
            else
                prevValue = value.y;
        })
         
    })
          
    widget.on('render', function(sender,se){
    for (var i = 0; i < sender.queryResult.series.length; i++ ) {
        for (var j = 0; j < sender.queryResult.series[i].data.length; j++) {
            sender.queryResult.series[i].data[j].marker.enabled = false;
             }
        }
    }
    )

    This shows original data at left, one of the connectNulls scripts from above in the middle, and this script at the right.

  • Hi Chris, thanks for this! Not sure if I'm implementing correctly--it's not connecting the line breaks. I tried a hard reload and logging out, which usually does it for the other script connector.

    I believe I was attempting to do something similar in the value formula itself with the below CASE before giving up. I kept getting the Yellow Exclamation Point of Sadness.

    CASE
    WHEN [Total Ticket Paid Count]>0 THEN RSUM ( [Total Ticket Paid/Reserved Count] ) / ( [Total Seat Count] , ALL ( [Weeks in Date]) )
    WHEN [Total Ticket Paid Count]= null THEN (RSUM ( [Total Ticket Paid/Reserved Count] , prev([Weeks in Date] , 1)) ) / ( [Total Seat Count] , ALL ( [Weeks in Date]) )
    ELSE Null
    END

  • Gabrielle,

    You could attempt to make a new widget with the same exact settings and then add the script. I've had to do that before. It seems that it only allows you to update the script once per widget sometimes.

    Neil

  • Apologies Gabrielle,

    I didn't account for there being a break by. I'm slated to be OOO for a couple weeks, but will come back to this.

  • I've had issues with adding in scripts in the past and a friend at hosted services told me that after adding in the script and saving go back to the widget page and reload with [F5] . It's been a while and I don't have analytics with me but I think that was the magic.

  • Hi Gabrielle,

    To recap, the script I provided covered the case when treating one or more values, without using a break by. When using a break by, there can only be one value in play. Here's an updated script that iterates over the break by series and applies the desired treatment.

    widget.on('processresult', function(se, ev){

    $.each(ev.result.series, function(seriesIndex, seriesValue){

    var prevValue = seriesValue.data[0].y

    $.each(seriesValue.data, function(index, value){
    if(value.y == null)
    value.y = prevValue
    else
    prevValue = value.y
    })

    })

    })

    widget.on('render', function(sender,se){
    for (var i = 0; i < sender.queryResult.series.length; i++ ) {
    for (var j = 0; j < sender.queryResult.series[i].data.length; j++) {
    sender.queryResult.series[i].data[j].marker.enabled = false;
    }
    }
    }
    )

  • Chris, this is great!! Works perfectly. Thank you for all your help here! 

Reply Children
No Data