Skip to content

Example for a dodge dot plot with the tooltip mark? #2304

Answered by Fil
df-rw asked this question in Q&A
Discussion options

You must be logged in to vote

In https://observablehq.com/@observablehq/plot-image-dodge

you could add tip: true:

Plot.plot({
  inset: 20,
  height: 280,
  marks: [
    Plot.image(
      presidents,
      Plot.dodgeY({
        x: "First Inauguration Date",
        r: 20, // clip to a circle
        preserveAspectRatio: "xMidYMin slice", // try not to clip heads
        src: "Portrait URL",
        title: "Name",
        tip: true
      })
    )
  ]
})

Or, if you wanted to explicitly call Plot.tip:

Plot.plot({
  inset: 20,
  height: 280,
  marks: [
    Plot.image(
      presidents,
      Plot.dodgeY({
        x: "First Inauguration Date",
        r: 20, // clip to a circle
        preserveAspectRatio: "xMidYMin slice", /…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@df-rw
Comment options

Answer selected by df-rw
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