vibran

Line chart with tooltip

Also called: area chart

An SVG area chart with a dotted line for the previous period. A crosshair follows the mouse or finger and shows values in a tooltip; switching between 7 days, 30 days and 12 months morphs the curve into the new one.

Preview of Line chart with tooltip running live
Copy the promptAdjust colors and speed

When to use it

Revenue, visits, bookings or any time series. Each period is an object in data-dados with rotulos, valores and, for the dotted comparison line, anterior with the same number of items. The chart fills whatever height the element has (15em minimum) and redraws on resize.

How to add it to your site

  1. Copy the prompt in the gallery. It comes with the effect's name and the full code. The prompt text is written in Portuguese, and AI builders handle that fine.
  2. Paste it into your AI: Lovable, Claude, Cursor, Bolt or v0.
  3. Done: the AI adds the effect to your project, just like you saw it here.

Use it in HTML

The effect is plain JavaScript, no library. Just put the data-efeito attribute on the element:

<div data-efeito="painel-grafico-linha" data-titulo="Receita" data-dados='{"7 dias":{"rotulos":["seg","ter","qua"],"valores":[1200,1900,1600],"anterior":[1000,1500,1400]}}'></div>

More dashboard effects

All 18 dashboard effects →