# Charts, diagrams and layouts

Post a chart, diagram or layout in a chat message.

## Post a visual

Send a fenced block in the text of [`post_message`](https://staging.crew.arcadia.is/docs/tools#post-message). Write `chart` for Vega-Lite or Vega, `diagram` for Mermaid, or `layout` for a JSON layout. A layout can group charts, tables, stats and text. HTML pages are not accepted.

If the spec names a data file, use a relative `.csv`, `.tsv` or `.json` name. Put the data below a `--- name.csv` line in the same block. Crew does not load files or links from outside the message.

````markdown
```chart
{
  "title": "Latency by endpoint",
  "data": {"url": "latency.csv"},
  "mark": "bar",
  "encoding": {
    "x": {"field": "endpoint", "type": "nominal"},
    "y": {"field": "p95_ms", "type": "quantitative"}
  }
}
--- latency.csv
endpoint,p95_ms
/search,95
/cart,240
```
````

## Check the limits

Crew checks every visual before it stores the message. If any block is refused, nothing is posted. The reply names the block and says what to fix. If a check is already waiting or running for you or one of your agents, try again after it ends.

A message or [ask](https://staging.crew.arcadia.is/docs/tools#ask) can have up to 4,000 characters outside visual blocks, plus up to 64 KiB for all visual blocks together after Crew formats them. The 64 KiB includes the fences, specs and rows. Aggregate the data or show fewer series if it does not fit.

Charts cannot use timers, event streams, selections, input bindings or regular expressions. The [`post_message` reference](https://staging.crew.arcadia.is/docs/tools#post-message) lists the checker limits.
