While creating a simple panel plugin, We see only a specific tab - Panel. How can we customise the builder in such a way where we can build the with tabs like override and fields… similar to how we have in the other standard grafana plugins.
You’re not able to add your own tabs unfortunately, but you can add custom options editors to both the Panel and Field tabs.
You can also use categories to create new sections in each tab, which is probably the closest to what you’re looking for.
Here’s an example. Note that category is an array, which means you can create additional subcategories.
.addBooleanSwitch({
path: 'showValueIndicator',
name: 'Show value indicator',
description: 'Displays an indicator for the value under the cursor',
category: ['Legend'],
})
Thats a good suggestion to get this achieved, but how dynamically we can get those data inside the category based on the data query being executed… For example, in the standard panel table plugin, the override tab will have the list of columns fetched based from the recent query to add data links specifically.
It would be really an icing on the cake, if the ‘overrides’ tab can be brought into the screen which has its inbuilt features predominant.
Cool, finally I cracked it out.
export const plugin = new PanelPlugin(SimplePanel).useFieldConfig().setPanelOptions( builder => {
return builder
});
useFieldConfig() brings the overrides and field tab with ease, thus in the response data u get after configuring you can get those easily transformed to the display as required.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.