Display Unassigned as a category

by tonio94 » Thu Dec 08, 2016 4:32 pm

Hi team,

Wonderful tool !!! I'm building some Dashboards and I'm facing an issue with unassigned tasks.

One of these dashboards is a chart of tasks categorized by asignee. The problem is that all unassigned tasks are in this chart as well (they are displayed which is good) but not displayed in the legend.

Would there be a kind of way to display these Unassigned tasks as a category with a legend in addition to my assignee ?

Ex :
Assignee 1 : Task1, Task2
Assignee 2 : Task3
Unassigned : Task4, Task5

In addition my chart is filtering a list. I managed to get correct filter when not assigned but wouldn't want to break all :)

Here's my code at the moment :

Code: Select all
var handlers = {};
handlers.preRender = function (config, logger) {
    logger.debug('Configuration: ', config);
 
    var filtrationApplied = false;
 
  config.plotAreaClick = function (e) {
          if (!filtrationApplied) {
            window.location.hash = '';
        }
 
        filtrationApplied = false;
    }
 
    config.seriesClick = function (e) {
        if (ctx && ctx.clvp) {       
            var filter =
              'FilterField1=Owner-FilterValue1=' + e.dataItem.value;
         
/*Clear the value to filter the list in case the value is "undefined"*/
 if(String(e.dataItem.value).indexOf("u")!=-1)
          {
            e.dataItem.value='';
          }
     
            window.location.hash = 'InplviewHash' +
            ctx.clvp.wpid + '=' + encodeURIComponent(filter);
            filtrationApplied = true;
        }
    }
    return true;
}
tonio94
 
Posts: 4
Joined: Thu Dec 08, 2016 4:09 pm

by Dmitry Kozlov » Fri Dec 09, 2016 12:07 pm

Hi,
Could you drop a template of the source list with data (List settings -> Save this list as template) and chart's configuration (Export it in Dashboard Designer) to support@spchart.com?
User avatar
Dmitry Kozlov
 
Posts: 129
Joined: Wed Nov 12, 2014 3:24 pm

by tonio94 » Wed Dec 14, 2016 10:00 am

Hi Dimitry,

Thanks for your answer, just sent you the files :)
tonio94
 
Posts: 4
Joined: Thu Dec 08, 2016 4:09 pm

by Dmitry Kozlov » Wed Dec 14, 2016 12:10 pm

Hi,
Please, use this code in Dashboard -> Advanced:

Code: Select all
var handlers = {};
handlers.preRender = function (config, logger) {
    logger.debug('Configuration: ', config);

    var filtrationApplied = false;
    config.series[0].data[0].value = "Unassigned";
    config.plotAreaClick = function (e) {
        if (!filtrationApplied) {
            window.location.hash = '';
        }

        filtrationApplied = false;
    }

    config.seriesClick = function (e) {
        if (ctx && ctx.clvp) {
            var filter =
                'FilterField1=Owner-FilterValue1=' +
                ((e.dataItem.value == "Unassigned") ? '' : e.dataItem.value);

            window.location.hash = 'InplviewHash' +
                ctx.clvp.wpid + '=' + encodeURIComponent(filter);

            filtrationApplied = true;
        }
    }
    return true;
}
User avatar
Dmitry Kozlov
 
Posts: 129
Joined: Wed Nov 12, 2014 3:24 pm

by tonio94 » Wed Dec 14, 2016 1:15 pm

Works perfectly Thanks a lot !
tonio94
 
Posts: 4
Joined: Thu Dec 08, 2016 4:09 pm


Return to Dashboard Designer for SharePoint 2013