Tips and recipes
Get the right currency, describe the visual well, change it in small steps, and make it look right in every theme, size and PDF
Most of what makes a good custom visual is set on the card, not in the HTML. These tips cover the choices that matter most, in the order you meet them.
Get the right currency and number format
A visual shows each value exactly as the card's table shows it. So when a visual prints the wrong currency, too many decimals or a raw date, fix the format on the card, not in the visual or in your request to the assistant.
| Where the value comes from | Where to set its format |
|---|---|
| A measure on a card built from fields | The field's format, from its menu on Metrics |
| A column on a SQL card | The column's settings, from its header on the Results tab |
| A field in a semantic domain | The field's format in the domain, used by every card unless the card sets its own |
| Any currency value with no currency of its own | The report's default currency in Display formats |
The card's format wins over the domain's, and both win over the report's default. Numbers the visual works out itself, such as an axis tick or a total, use the same field's format, so a revenue axis reads "$2M" when the revenue cells read "$1.23M".
Don't ask the assistant for a currency symbol
A request such as "show values in euros" makes the assistant add a symbol by hand, which then disagrees with the card. Set the currency on the field or column, and every value, tick and total follows. Formats never convert amounts: changing USD to EUR changes the symbol, not the number.
Name fields the way you want them read
The visual labels its legend, axes and tooltips with your field names.
- On a card built from fields, rename the field on its shelf: "Revenue" reads better than "Sum of amount".
- On a SQL card, alias every column:
SUM(amount) AS "Revenue". - Use the same names in your request, so the assistant knows which field you mean: "the bar is Revenue, the tick is Revenue goal".
Describe the visual you want
Say what the chart shows and what matters in it. The prompt already covers colours, fonts, formats, sizes and dark mode.
A few things to include when they matter:
- The chart type, or a picture in words: "a ring per region, filled to its share of the goal".
- Which field does what: "rows are products, the colour is the margin".
- Order: largest first, the card's order, or by date.
- Emphasis: "highlight the current month", "mark anything below target".
- Options to keep: "add a setting for the number of rows to show".
Change it in small steps
- Ask for one change at a time, in the same conversation: "make the labels smaller", then "sort by margin". Each reply replaces the whole visual, so small steps are easy to check.
- With your own assistant, start each change from View prompt on the Code tab. That prompt includes the current code, so the assistant changes your visual rather than writing a new one.
- Use Settings for things you'll tweak often. Ask for a setting once, then flip it in the panel instead of asking again.
- Start over in the panel takes the visual off the card if you'd rather begin again.
Colours
- Let the theme colour it. By default a visual uses your brand's palette, in order, and its colours for good, bad and caution.
- For a specific colour, ask for a colour setting: "add a setting for the highlight colour". You then pick from your theme's colours in the panel, and the choice follows light and dark mode.
- Ask for an exact colour only when you mean it, such as a colour your company always uses for one product line. It won't adapt to dark mode.
Light and dark mode
A visual follows the viewer's light or dark mode on its own. If text is hard to read in one of them, the panel warns you about low contrast. Ask the assistant to fix the text that the warning names.
Sizes
- Resize the card in the editor and watch the preview: the visual should simplify as the card shrinks, not cut off or overlap.
- Tell the assistant the smallest useful size when it matters: "at small sizes, show only the top five regions and the total".
- If the panel warns that content is cut off at a small size, ask the assistant to show less when the card is small.
PDFs and scheduled reports
A custom visual prints as it shows on screen, at the card's size, with animations off. PDFs and scheduled reports wait for it to finish drawing. If it can't draw, the PDF shows the card's table, as the dashboard does. Size the card in the editor so the visual reads well at the size it prints.
Lots of rows
A visual shows the rows that fit and says how many more there are. To control which rows those are:
- Sort the card so the rows that matter come first.
- Limit the card to the top rows you want drawn, such as the top 20 products.
- Group less finely: months instead of days, regions instead of cities.
Chart libraries
You can ask for a visual built on a well-known chart library, such as ECharts, Chart.js or Vega-Lite: "use ECharts for this". The prompt tells the assistant how to use one so that it still follows your brand. For simple charts, plain HTML and SVG need no library at all; the templates are built that way.