Invocation
Supported chart types
| Type | When to use |
|---|---|
bar | Comparing discrete categories |
line | Trends over time or ordered sequences |
pie / doughnut | Part-to-whole relationships |
radar | Multi-dimensional capability comparisons |
| Time series | Dense temporal data with date-based x-axis |
Data format
Provide data in any natural form — the skill extracts labels and values from context. You can supply:- A table pasted into the conversation
- A list of numbers with labels
- A description such as “revenue was 120 in Jan, 145 in Feb, 130 in Mar”
The skill uses the Chart.js CDN (
chart.umd.min.js v4.4.1) and renders entirely in the browser. No data leaves your machine.Workflow
Extract data and chart type
Identify labels, datasets, and chart type (bar, line, pie, doughnut, radar) from the user’s request or conversation context.
Choose colors
Assign dataset colors from the standard palette defined in
TEMPLATE.md. No ad-hoc inline colors.Write the HTML file
Write a complete self-contained file to
/tmp/chart.html using the Chart.js template matching the chart type.Wait for render
Call
mcp__chrome-devtools__wait_for on a static DOM element (an <h2 id="ready"> placed above the canvas). Chart.js renders to canvas — canvas text is not detectable by wait_for. Timeout 10000ms.Take screenshot
Call
mcp__chrome-devtools__take_screenshot and verify the chart is visible with labeled axes and readable text.Use cases
Benchmark comparisons
Compare throughput, latency, or accuracy across models, tools, or configurations with a grouped bar chart.
Trend analysis
Plot metrics over time — revenue, signups, error rates — with a line or time series chart.
Capability radar
Score multiple dimensions (speed, accuracy, cost, reliability) for each option on a radar chart.
Self-review checklist
Before delivering, the skill verifies all of the following:- Screenshot shows the chart with visible title, labels, and data — no blank canvas
- Chart text is readable on dark background — not invisible black-on-dark
- Container div has explicit
height(e.g.500px) in CSS — not just on the canvas element - Both
responsive: trueandmaintainAspectRatio: falseare set in chart options Chart.defaults.colorandChart.defaults.borderColorare set beforenew Chart()- Dataset colors are from the standard palette — no ad-hoc inline colors
- CDN URL is exactly
https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.1/chart.umd.min.js wait_foris called with the chart title text beforetake_screenshot
Golden rules
1. Never set width or height on the canvas element
1. Never set width or height on the canvas element
Set dimensions on the wrapper div via CSS (
height: 500px). Canvas attributes override Chart.js responsive sizing.2. Always set both responsive: true and maintainAspectRatio: false
2. Always set both responsive: true and maintainAspectRatio: false
Either setting alone is insufficient — the chart collapses to 0 height without both.
3. Always set Chart.defaults before creating any chart
3. Always set Chart.defaults before creating any chart
Set
Chart.defaults.color and Chart.defaults.borderColor before new Chart(). Without them, all text renders as black and is invisible on the dark background.4. Always use new_page for first open
4. Always use new_page for first open
Use
mcp__chrome-devtools__new_page with url: file:///tmp/chart.html. Use navigate_page with type: reload only for subsequent fixes.5. Always add a static element and wait_for it
5. Always add a static element and wait_for it
Add an
<h2 id="ready"> above the canvas and call wait_for on it. Chart.js renders text onto canvas — canvas text is invisible to wait_for. The static element is the only reliable render signal.6. Never hardcode colors inline in datasets
6. Never hardcode colors inline in datasets
Always use colors from the standard palette array defined in
TEMPLATE.md.Reference files
| File | Contents |
|---|---|
TEMPLATE.md | Complete Chart.js HTML templates for bar, line, and pie/doughnut; color palette; data format patterns |
TROUBLESHOOTING.md | Failure diagnosis table: symptoms, causes, fixes |