// Tableau + AI · Prompts · Viz extensions
Prompts That Build Good Tableau Viz Extensions
A copyable prompt library: a base prompt plus eleven chart prompts, each tied to a finished extension in the gallery, and the five things every good Tableau extension prompt spells out.
OCT 14, 2026
Most bad Tableau extensions I see from AI aren't bad code. They're vague prompts. "Make me a bullet chart" leaves Claude to guess which fields go where, what happens with no data, how numbers are formatted and what it looks like on a dark dashboard. It guesses, and you spend the next hour correcting the guesses.
This is the prompt library I actually use. Each prompt is tied to a real extension in the TableauOps gallery, so you can compare what you get against a finished one. Copy them, change the fields, and run them in Claude Code, in Studio, or through the TableauOps MCP connector.
What makes a good prompt for a Tableau viz extension?
Five things, and almost every failed build is missing at least one.
- Encodings. A viz extension only sees the fields you declare as Marks card tiles. Name every tile, say whether it takes a dimension, measure or date, and which are required. Keep it to two to four tiles: Tableau caps a viz extension at four, and every tile needs a different icon.
- Empty states. Say exactly what the pane shows before the required tiles are filled. "Drag a measure onto Value" beats a blank box every time.
- Format options. Numbers, dates, abbreviations (
1.2Mversus1,200,000), sort order, label rules. If you don't say, you get whatever Claude picks. - Theming. One accent color, a light and dark theme, and a configure dialog to change them. Never hard-coded colors in the draw code.
- Size behavior. The pane can be any size on a dashboard. Ask for no scrollbars, and for labels and legends to drop away gracefully when it gets small.
Interaction is the sixth, when it matters: click a mark to select it in Tableau, hover for a tooltip.
The base prompt: paste this first
I paste this once at the top of a session, then add one chart prompt at a time. It carries the rules every chart shares, so the chart prompts stay short.
You're building Tableau VIZ extensions: custom mark types on a worksheet's
Marks card, not dashboard extensions. For every chart in this session:
- Declare 2 to 4 Marks card tiles. Each has an id, a display name, what it
accepts (dimension, measure or date), whether it's required, and a
distinct encoding-icon token. Never use the ids "detail" or "tooltip".
- Read fields by tile id with getVisualSpecificationAsync, never by column
order. Use nativeValue for math and formattedValue for labels.
- Until every required tile is filled, show a centered message naming the
missing tiles. Never render a blank pane.
- Re-render live on data changes and on resize. No scrollbars at any size.
Below roughly 300px wide, drop the legend first, then labels.
- Theme from CSS variables: one accent, muted grays for everything else,
light and dark themes. Configure dialog with accent, theme and size.
- Click a mark to select it in Tableau; click empty space to clear.
- Outside Tableau, render sample data with a small DEMO DATA badge.If you're using the TableauOps MCP connector or Studio, the host handles the manifest and hosting, and the tiles go on the // fields: line of the component. The component contract explains that format. If you're building plain files in Claude Code, the free extension skill carries most of the base prompt for you.
1. How do you prompt for a metric card?
Compare with: Metric Card
Build a metric card viz extension.
Tiles: Measure (measure, required), Date (date, required).
Show the latest period's value as a big abbreviated number (1.2M, 340K),
a delta chip versus the prior period as a signed percent, green up and
red down, and a sparkline of the full trend underneath with the latest
point marked.
Empty state: "Drop a measure on Measure and a date on Date".
Config: accent, theme, number format (abbreviated, full, currency),
and whether "up" is good or bad, so cost metrics color correctly.That last config line is the one people forget. A rising cost shouldn't be green.
2. How do you prompt for a KPI scorecard with several metrics?
Compare with: KPI Scorecard
Build a KPI scorecard viz extension.
Tiles: Measure (measure, required, allow up to 4 fields), Date (date,
required).
One row per measure: the name, the current value, change versus prior
period, and a small trend line. Rows share one width so numbers align.
Format each number by its own magnitude. Right-align numbers with
tabular digits.
If a measure has only one period, show the value and "no prior period"
instead of a 0% change.3. How do you prompt for a bullet chart?
Compare with: Bullet Chart
Build a bullet chart viz extension.
Tiles: Category (dimension, required), Value (measure, required),
Target (measure, optional).
One row per category: a dark value bar over three light qualitative
bands (poor, fair, good at 60%, 80% and 100% of target, configurable),
and a thin vertical tick at the target.
If Target is empty, hide the tick and bands and say "Add a target to
see bands" in small text.
Sort by value descending by default; config toggle for alphabetical.4. How do you prompt for a dumbbell chart?
Compare with: Dumbbell Chart
Build a dumbbell chart viz extension.
Tiles: Category (dimension, required), Start (measure, required),
End (measure, required). Give Start and End the arrow-left and
arrow-right icons.
One row per category: a gray dot for Start, an accent dot for End,
joined by a line. Color the line by direction (improved vs declined,
configurable which is good). Label the gap at the end of each row.
Sort by the size of the gap, largest first.5. How do you prompt for a lollipop chart?
Compare with: Lollipop Chart
Build a lollipop chart viz extension.
Tiles: Category (dimension, required), Value (measure, required),
Color (dimension or measure, optional).
A thin muted stem and an accent dot per category, sorted descending,
with the value labeled past the dot. Negative values extend left across
a zero line.
If Color is a dimension, use a categorical palette starting with the
accent. If it's a measure, use a light-to-accent ramp.6. How do you prompt for a waffle chart?
Compare with: Waffle Chart
Build a waffle chart viz extension.
Tiles: Category (dimension, required), Value (measure, required).
A 10 by 10 grid where each cell is 1% of the total. Fill cells in
category order, largest first, colored by category. Round so the grid
always totals exactly 100 cells.
Legend: category, color and percent. Hide the legend below 300px wide.
If one category is under 0.5%, list it in the legend as "<1%" rather
than dropping it silently.7. How do you prompt for a Sankey diagram?
Compare with: Sankey Diagram
Build a Sankey diagram viz extension.
Tiles: Source (dimension, required), Middle (dimension, optional),
Target (dimension, required), Value (measure, required).
Nodes as columns, ribbons weighted by Value, colored by Source at low
opacity. Hover a ribbon to highlight it and show source, target and
value; hover a node to highlight every ribbon through it.
If Middle is empty, draw two columns. Cap at 2,000 ribbons, keeping the
largest, and note "showing top N flows" in small text when capped.8. How do you prompt for a ridgeline chart?
Compare with: Ridgeline
Build a ridgeline (joy plot) viz extension.
Tiles: Category (dimension, required), X Axis (measure or date,
required), Height (measure, required), Color (optional).
One filled ridge per category over a shared x axis, ridges overlapping
by a configurable amount (default 50%), category labels on the left.
Sort categories by the x position of each ridge's peak.
Config: overlap, accent, fill opacity, theme.9. How do you prompt for a scatter plot with a fit line?
Compare with: Super Scatter
Build a scatter plot viz extension.
Tiles: X (measure, required), Y (measure, required), Label (dimension,
optional), Color (optional). Use the letter-x and letter-y icons.
Draw a least-squares fit line and show the slope, R squared and point
count in a small stats box. Recompute them for the selected points
when the user selects marks.
Low alpha on dots so overplotting reads as density. Label only the five
most extreme points, by distance from the fit line.10. How do you prompt for a styled data table?
Compare with: Supertable
Build a data table viz extension.
Tiles: Columns (any, required, allow multiple fields).
Sticky header, right-aligned numbers with tabular digits, left-aligned
text. Click a header to sort; click again to reverse. Light row
striping in the theme's track color.
Number formatting per column from the field's own format. Show a total
row for measures, toggle in config.
Never scroll the page: if rows overflow, the table body scrolls inside
the pane and the header stays put.That last line is a deliberate exception to the no-scroll rule. Tables are the one place an inner scroll makes sense, so say so explicitly or Claude will follow the base prompt and shrink the text instead.
11. How do you prompt for a radial bar chart?
Compare with: Radial Bar
Build a radial bar viz extension.
Tiles: Category (dimension, required), Value (measure, required),
Color (optional).
One concentric ring per category, each arc sweeping clockwise from 12
o'clock by its share of the largest value, longest on the outside.
Labels at the start of each ring with the value. Max 12 rings; group
the rest as "Other" and say so.How do you iterate on a viz extension after the first prompt?
The first result is a draft. Follow-ups should be small and specific:
The labels overlap below 400px wide. Hide every other label under 400px,
and all labels under 250px.Make the target tick 2px and use the theme's text color, not the accent.When I filter to one category the chart is one huge bar. Cap bar
thickness at 28px and center the rows vertically.When something errors in Tableau, paste the exact error text with its code, not a description of it. FD722608 and ED626076 mean specific things, and Claude can fix them on sight. The full list is in the errors every Tableau extension throws.
What should you leave out of a Tableau extension prompt?
- Library choices. On the hosted path, React and D3 are provided and nothing else is. On the plain-files path, the skill already says no build step.
- Manifest XML. Describe the tiles; let the skill or the host write the XML.
- "Make it beautiful." It means nothing. Say one accent, muted grays, mono numbers, and what to drop at small sizes.
Your next step
Pick the chart closest to what you need, open its page in the gallery to see the finished version, then run the prompt. To skip the setup, paste the result into Studio, or connect the MCP connector and let Claude publish it. The full walkthrough is in build a Tableau extension with Claude, and the rest of the series is on the Tableau + AI hub.
Frequently asked questions
- What should a prompt for a Tableau viz extension include?
- The Marks card tiles with what each accepts and which are required, the empty-state message, number and date formatting, theming with one accent and a dark theme, and how the chart behaves at small sizes. Add interaction rules if marks should select in Tableau.
- How many encodings can a Tableau viz extension have?
- Up to four custom Marks card tiles, each with a different icon token. Two to four is the practical range: required tiles for what the chart needs, optional ones for enrichment like color.
- Can I use these prompts without Claude Code?
- Yes. Paste them into any Claude chat with the TableauOps MCP connector enabled and Claude publishes a hosted extension, or adapt them into a component in Studio in your browser.
- Why does my AI-built viz extension render blank?
- Usually no tiles were declared, so there's nowhere to drop fields, or the required tiles are empty and there's no empty-state message. Declare the tiles in the prompt and ask for a message naming the missing ones.