Plugin - HideChartTypeByGroup
export const config = {
// Chart types to hide in the dropdown, case sensitive, include full name
chartTypesToHide: ["Bar Chart", "BloX"],
// Members of these groups will have this plugin modify the dropdown
// Group unique OID, can be copied from group API or from prism.user.groupNames
userGroupToModify: ["6532f4a99760e6cbf6e18585", "3265f4a99760e3bbe3e18517"]
}
Tip - Include the full name of the Chart type exactly as it appears in the dropdown to avoid potentially hiding Charts that also include the string.
Below is an example of the plugin hiding the Bar Chart option in the widget selection dropdown for a user that is a member of one of the groups set in userGroupToModify.
How did the plugin work for you? What other type of plugin are you looking to learn more about? Let me know in the comments!
Team Lead, Software Engineering of FES SWE at Sisense
2 comments
Jeremy Friedel
OP2 years agoHi Alib,
Happy to hear that this plugin is helpful!
The original Sisense customer that this plugin was developed for had previously hidden the entire widget icon menu via custom plugin CSS for all users, so it was not part of the original plugin functionality.
It is possible to hide the icon for all users (not group specific) by using standard CSS rules applied by a plugin, including this plugin.
Modifying the plugin.json file of this plugin replacing the empty style attribute array with the name and file path of a CSS file or files present in the plugin folder:
Then creating a CSS file in the folder matching the file name and path (in this case style.css in the main plugin folder), any standard CSS rules can be applied.
In the latest version of Sisense the area chart icon icon can be removed from the new chart icon bar with the following CSS rule:
If you would like to share your email via a private Community message a Google Drive link with those specific CSS changes applied to the plugin can be shared.
Alib
·2 years agoThis works for the advance configuration when creating a new widget or from the edit widget. However, when creating a new widget, the list of charts still includes icons that was filtered out.
For example, I filtered the "Area Map" out from the drop down on the edit widget page, but I can still choose the icon on the new widget menu from the right panel.
How can the "Area Map" be filtered out of new widget menu side panel?