Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to configure Shared Tooltip for dashboard #476

Closed
jamesatkin-pexip opened this issue Mar 23, 2022 · 2 comments
Closed

Way to configure Shared Tooltip for dashboard #476

jamesatkin-pexip opened this issue Mar 23, 2022 · 2 comments

Comments

@jamesatkin-pexip
Copy link

What you expected to happen?

I expected an option to configure a dashboard to use "Shared Tooltip", seen below in the UI.

image

What happened?

There's no option for this in the Dashboard class.

Additional info

I did try writing a wrapper for this to hack it into the JSON output:

class MyDashboard(Dashboard):
    graphTooltip = 2

    def to_json_data(self):
        parent_dashboard = super().to_json_data()
        parent_dashboard["graphTooltip"] = self.graphTooltip
        return parent_dashboard

Putting this through the generator does produce the correct value ("graphTooltip": 2) in the output:

{
  "__inputs": [],
  "annotations": {
    "list": []
  },
  "description": "",
  "editable": true,
  "gnetId": null,
  "graphTooltip": 2,
  "hideControls": false,
   ...
}

However, importing this JSON into Grafana on the UI doesn't retain the option, and the dashboard doesn't have a shared tooltip.

@mharbison72
Copy link
Contributor

I bet you need to set the schemaVersion on the dashboard object to something newer. 12 is getting set by default, but my local grafana 8.5.2 is generating dashboards with 36 as the value.

I'm curious what the strategy to handle this should be- there are at least a handful of attributes that are being created by grafanalib that are no longer created by grafana, and it would be nice to skip the old stuff if it's not needed. But I assume bumping the default to a new value would cause breaking people with older grafana installations, and not be accepted.

mharbison72 added a commit to mharbison72/grafanalib that referenced this issue May 24, 2022
@aj-sx
Copy link

aj-sx commented Feb 9, 2023

dashboard.schemaVersion needs to be set to 14, this is where the feature got probably introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants