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
XyChart: Support adding calcs to legend #87155
Conversation
This PR must be merged before a backport PR will be created. |
1 similar comment
This PR must be merged before a backport PR will be created. |
@@ -68,17 +78,82 @@ export const XYChartPanel2 = (props: Props2) => { | |||
getItemKey: () => `${idx}-${s.name.value}`, | |||
fieldName: yField.state?.displayName ?? yField.name, | |||
disabled: yField.state?.hideFrom?.viz ?? false, | |||
getDisplayValues: () => { |
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.
Is this function different than the one used in PlotLegend?
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.
Or in the original XYChart? Maybe we can DRY it out if it is?
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.
Pushed a quick update. The plan was to extract it to a separate component, but not today apparently 😅
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.
Nice!
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-87155-to-v11.0.x origin/v11.0.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 8a96fcedb2f29f60d9a1fffeb0828e38a9cd4f4a When the conflicts are resolved, stage and commit the changes:
If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-87155-to-v11.0.x
# Create the PR body template
PR_BODY=$(gh pr view 87155 --json body --template 'Backport 8a96fcedb2f29f60d9a1fffeb0828e38a9cd4f4a from #87155{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title "[v11.0.x] XyChart: Fix legend" --body-file - --label "type/bug" --label "area/frontend" --label "area/panel/xychart" --label "no-changelog" --label "backport" --base v11.0.x --milestone 11.0.x --web Or, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-87155-to-v11.0.x
# Create a pull request where the `base` branch is `v11.0.x` and the `compare`/`head` branch is `backport-87155-to-v11.0.x`.
# Remove the local backport branch
git switch main
git branch -D backport-87155-to-v11.0.x |
Fixes #85034
Please check that: