Org Chart select event

Forums SPJS Charts for SharePoint Org Chart select event

This topic contains 3 replies, has 2 voices, and was last updated by  Phil Grant 2 months ago.

  • Author
  • #19190

    Phil Grant

    It is possible to filter a sub chart from the master based on the filters used but is it possible to filter the sub chart based on a selection made in the master chart, this is in the Org Chart.

    I have a table chart view under the org chart view that has extra information shown and I would like to limit the table chart to the selected box in the org chart above.


  • #19214

    Alexander Bautz

    Yes, you can use this custom js. You can put it in a script editor web part in the page where you have the chart or put it in a file and refer it in the “Load external JS or CSS” tab in the chart config. If you use a script editor web part you must wrap the code in a <script> tag.

    function orgChartSelectHandler(id) {
        try {
  [id], "select", function (e) {
                var selection =[id].getSelection(), data =[id], item, selectedItem = "";
                for (var i = 0; i < selection.length; i++) {
                    item = selection[i];
                    selectedItem = data.getFormattedValue(item.row, 0);
        } catch (ignore) {
            setTimeout(function () {
            }, 1000);

    You must edit the snippet and replace “YOUR_ORG_CHART_ID” with the ID of your org chart, and “ID_OF_FILTER_SELECT_IN_TABLE_CHART” with the ID of the dropdown select filter above your table chart (you must set up a filter in the table chart configuration). To find the ID, right click the dropdown select and click “inspect”. You will find the ID attribute in the HTML code

    Let me know how this works out.


  • #19231

    Phil Grant

    Thanks for that, I’ll give it a try, I’m just delving into your dynamic forms wrapper at the moment …. Brilliant.


  • #19341

    Phil Grant

    It worked a treat thanks, once I’d figured out the correct filter ID in the table.


You must be logged in to reply to this topic.