Search code examples
powerbipowerbi-embedded

Customize visualization toolbar in PowerBi embedded editor


Is it possible to customize the visualizations toolbar of the PowerBi embedded editor? I want to hide some visual (for example all the charts, and leave only the table visuals)

Power Bi Embedded


Solution

  • Working with PBIE too. Currently there is no legal way to customize/hide visuals pane via API or SDK. You always can play with jQuery selectors for hiding things. As idea just set event handler on rendered and then try something like $(".visual-types-container button").slice(0,24).each(function(elem) { $(this).remove();}) Plus handle special cases like expand/collapse pane:

    $("article.visualizationPane button.toggleBtn").on("click", function() {
      var parent = $("article.visualizationPane");
      console.log("catch");
      if(!parent.hasClass("isCollapsed"))
      {
       var showVisuals = ["Slicer", "Table", "Matrix"];
       $("article.visualizationPane div.visual-types-container button").filter(function() 
       {
            return -1 == showVisuals.indexOf($(this).attr("title"))
       }).each(function() {
            $(this).remove();
       });
      }
    });
    

    Everything can be broken once Microsoft released changes with new UI design.