Can you create vertical annotations in chart components?

  • Goal: I would like to add vertical annotations on charts in Retool on specific dates (using Retool's chart component). Is there a way to do this?

  • Steps: I didn't see this in the docs, so wanted to check here to see if I'm missing something and if this is possible.

  • Details: My base query has all bookings and dates. I use a toggle to pick the date grouping -- to let my end user toggle between week/month/year (formulas in screenshot below).

  • Screenshots:
    Here's an example of what I mean from a Google Trends graph -- where you can see the vertical line at a certain date, and see the note when you hover over it. I'm looking to do something like that, where the source data is a list of dates and annotations.

Hey @megan :wave: There is no out-of-the-box way to do this, but it's possible to add a new series to your chart that is bar chart, with a single data point on the X axis corresponding to which date you would like to highlight, and a height of your max data point. You can wire up that X value to be anything; in the gif I linked I wired up the X value to be my range slider value (and also added a single scatter plot to show a dot with a label).

Let me know if that helps! Happy to explain further / walk through this with you

ohline

1 Like

Thanks so much, Cody! I will try this out!