Custom Panel plugin that uses the existing built-in Graph panel

Hi, I have developed a custom Panel plugin that renders some data in a leaflet map.
But now I need, in addition to my own UI , to also display a Graph panel.
I have been semi-successful by adding in my module.html the following line :

<div> my own panel's UI stuff</div>
<panel-plugin-graph dashboard="ctrl.dashboard" panel="myPanelSettings" row="ctrl.row" />

Now this works, I can add in the myPanelSettings.targets array a metric and the Graph panel renders fine.
The only problem is : it only works if in the same dashboard there is another row having a Graph panel.
If I remove that other row with the Graph panel , and have only one row with my own custom Panel plugin, then I do not see anything. The “panel-plugin-graph” directive does not initialize, in the browser debugger, I can see that the “panel-plugin-graph” element has not “expanded” to create the child html elements to display the graph. ( if there is another row having a Graph panel , everything “expands” and works fine ).

Now , I thought maybe I need to add a dependency to that plugin in my plugin.json, something like :

"dependencies": {
    "grafanaVersion": "3.x.x",
    "plugins": ["graph"]

“graph” is supposed to be the “id” of the built-in Graph panel. But this does nt work and actually breaks my own plugin , I get a “Unknown panel type: my-custom-panel”.

So my question is : what is the best way to re-use an existing built-in Grafana panel (namely the Graph panel ) within the context of my own Panel plugin and to be able to control it? ( e.g for the Graph panel I need to be able to set programmatically its target metric ).

Many thanks for your time,


Not sure to be honest - think you might be the first to attempt including a core plugin in another plugin. Grafana does not expose everything to plugins anymore and not sure if this is a scenario that we want to put effort into supporting either.

Hi Daniel, thank you for your reply and for your time