Add drill-down to your chart by linking it to a SharePoint l

Hi,

I have tried to follow the example on how to add drill-down to a chart by linking it to a SharePoint list http://www.spchart.com/documentation/link-chart-to-list

Could you please advise if there are errors in the code? I want to filter on “Issue Status”. The code has been copied in Dashboard → Advanced tab. Please see code below:

[code]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=IssueStatus-FilterValue1=' + e.dataItem.IssueStatus + '-'+ 
           
        window.location.hash = 'InplviewHash' +
        ctx.clvp.wpid + '=' + encodeURIComponent(filter);

        filtrationApplied = true;
    }
}

return true;

}[/code]

Thanks, in anticipation,

Vegard

Hi Vegard,
The code looks fine. Probably, you have multiple views on the page and the ‘ctx.clvp.wpid’ returns incorrect view Id. Try to compare URLs you get after clicking the chart series and filtering the view direclty by clicking its column headers.

Hi, Dmitry

I have removed all the views on the list. The URL is unaffected when clicking on the series.

Brg,

Vegard

The following condition returns ‘false’ when the page does not contain a list view:
if (ctx && ctx.clvp)

The page must contain at least one view to link the chart to it. Our support team can assist you with the task. Send the detailed requirements to support@spchart.com and we will estimate them.