Skip to content

Custom tooltip label with stacked chart #2189

Answered by Fil
mkfreeman asked this question in Q&A
Discussion options

You must be logged in to vote

In my example code it works:

Plot.barY(
  tidy,
  Plot.normalizeY("sum", {
    x: "state",
    y: "population",
    z: "state", // the series for normalizeY
    fill: "age",
    sort: { color: null, x: "-y" },
    offset: "normalize", // stack normalization (based on *x*)
    tip: {
      channels: {
        population: { value: "population", label: "Absolute population" } // 👈
      }
    }
  })
).plot({ y: { label: "Relative population (%)", percent: true } })  // 👈

Replies: 2 comments 2 replies

Comment options

Fil
Oct 7, 2024
Collaborator

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@Fil
Comment options

Fil Oct 7, 2024
Collaborator

Answer selected by mkfreeman
@mkfreeman
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants