-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Piechart: Implements series override -> hide in area for the legend or tooltip #51297
Conversation
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/23724 |
const hideFromViz = value.field.custom.hideFrom.viz; | ||
const hideFromLegend = value.field.custom?.hideFrom?.legend; | ||
|
||
if (hideFromLegend) { | ||
return undefined; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe
const hideFromViz = value.field.custom.hideFrom.viz; | |
const hideFromLegend = value.field.custom?.hideFrom?.legend; | |
if (hideFromLegend) { | |
return undefined; | |
} | |
const hideFrom = (value.field.custom?.hideFrom ?? {}) as HideSeriesConfig; | |
if (hideFrom.legend) { | |
return undefined; | |
} | |
const hideFromViz = Boolean(hideFrom.viz) |
it has the hideFrom time involved, so a little nicer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is nicer. Couldn't commit your suggestion as it was missing the import for HideSeriesConfig - so added it manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9628c9f
to
db66c8e
Compare
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/23895 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/23897 |
Drone build failed: https://drone.grafana.net/grafana/grafana-enterprise/24075 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hey guys what version is this live in? |
What this PR does / why we need it:
Missing functionality in the pie chart panel for the Series override -> Hide in area.
Shows hiding a country first from the legend and then from the multi tooltip.
Which issue(s) this PR fixes:
Fixes #49972
Special notes for your reviewer:
Not sure if there is a way to avoid duplication. There are two places where this series override is implemented already in the PlotLegend and the TooltipPlugin.
I looked at the PlotLegend code for the legend and tried to keep it similar. The tooltip logic is simpler than the TooltipPlugin implementation.