Blog / Build with AI /
Charts that tell the truth: building them with AI
A chart can tell the truth or tell a very convincing lie using the same numbers. The difference is often a few settings that nobody thinks about, such as where the axis starts.
When you ask an AI to build a chart, it will give you a pretty one, quickly. Pretty is not the same as honest. If you build reports for clients or for your own site, it pays to know the handful of rules that keep a chart straight, and to check the AI’s work against them.
The five ways charts mislead
1. A truncated axis on a bar chart. If bars start at 95 instead of 0, a rise from 96 to 98 looks like a doubling. Bar length represents quantity, so bars must start at zero.
2. Too much squeezing or stretching. The same line chart can look flat or alarming depending on how tall it is. There’s no perfect shape, but if the shape is chosen to drive a conclusion, be suspicious of it.
3. Cherry-picked time ranges. Show three weeks after a dip, and growth looks amazing. Show the full year, and it’s flat. Pick the range that answers the question honestly, and say what it is.
4. Mixed scales on two axes. Two lines on different left and right axes can be made to cross wherever you like. Use one axis when you can.
5. Missing context. “Traffic doubled!” Compared with what? From 20 visits to 40? A chart without units, dates and a source can’t be trusted.
Line charts can have a non-zero axis, because the line shows change rather than total quantity. Even so, label it clearly.
A checklist of honest chart habits
- Bars start at zero.
- Axes have labels with units.
- The time period is stated, and it’s long enough to include normal ups and downs.
- The title says what the chart shows, not what you want people to feel.
- The data source and date are somewhere on the chart or beside it.
- Colours differ enough for people with colour vision difficulties, and don’t rely on colour alone.
- Where numbers are small, show the numbers, not only the shape.
- Don’t use 3D effects. They distort what the eye reads.
- Pie charts only for a few parts of a whole that add to 100%.
Building it with a library
You don’t need to draw charts by hand. Chart.js is a popular, free JavaScript library for drawing charts in a web page. Ask the AI to use it, and to be explicit about the settings above.
A prompt that gets a good result:
Write an HTML page that uses Chart.js (loaded from a local file) to draw a bar chart of monthly visits from this data: [paste data]. The y-axis must start at zero. Add axis titles (“Month”, “Visits”), a chart title that describes the data neutrally, and a short source note under the chart. Use colours that are distinguishable without relying on hue alone. No animations. Add comments.
Include your real data in the prompt, or a small fake sample for the structure. Keep sensitive client data out of hosted AI tools.
What good output looks like
<canvas id="visits" width="640" height="360"></canvas>
<p>Source: site analytics export, January to June 2023.</p>
<script src="chart.min.js"></script>
<script>
new Chart(document.getElementById("visits"), {
type: "bar",
data: {
labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"],
datasets: [{
label: "Visits",
data: [1200, 1350, 1100, 1500, 1450, 1600],
backgroundColor: "#2a5d9f"
}]
},
options: {
animation: false,
plugins: { title: { display: true, text: "Monthly visits, January to June 2023" } },
scales: {
y: { beginAtZero: true, title: { display: true, text: "Visits" } },
x: { title: { display: true, text: "Month" } }
}
}
});
</script>
The numbers are made-up sample data, there only to show the structure. The line that matters is beginAtZero: true. Chart.js often picks a sensible axis on its own, but you shouldn’t leave honesty to a default.
Check the AI’s work
AI-built charts fail in predictable ways:
- Axis doesn’t start at zero on a bar chart. Look at the first number on the vertical axis.
- Data order is wrong. Months out of order, or labels shifted by one. Compare a couple of bars against your source.
- Invented data. If you asked for a “sample chart”, it may fill in numbers that look real. Don’t let sample numbers escape into a report.
- Smoothing lines. Some line charts use curves between points, which suggests data you don’t have. Ask for straight segments.
- Wrong chart type. A line for categories that have no order, or a pie with twelve slices.
- No source or date. Add them yourself if they’re missing.
Do the spot-check every time: pick two data points and confirm the chart matches your spreadsheet.
Choosing the chart type
| You want to show | Use |
|---|---|
| Change over time | Line chart |
| Compare categories | Bar chart (horizontal if labels are long) |
| Parts of a whole | Pie or stacked bar, only with few parts |
| Relationship between two numbers | Scatter plot |
| One number | Just write the number, big |
That last row is underrated. A single figure with a label often beats a chart.
Charts for website work
For web people, honest charts matter because we show people numbers all the time: traffic, conversions, rankings. Some typical traps:
- Reporting a percentage rise from a tiny base. “Clicks up 300%” might be three clicks becoming nine. Show the counts.
- Comparing partial months with full months. Mark the incomplete month or leave it out.
- Ignoring seasonality. Compare like with like, which is why year-on-year comparisons help. I wrote about measuring without self-deception in measuring content performance without vanity metrics.
- Starting the graph on a convenient date, like the day after a drop.
If you send reports to clients, a plain honest chart builds trust, and trust is worth more than a dramatic one.
Accessibility
Add a text alternative: a sentence under the chart that states the main point, or a small table with the numbers. A chart drawn on a canvas is invisible to screen readers. Giving the numbers in text helps everyone, including search engines.
Key takeaways
- Bars must start at zero; label axes; state the time range and source.
- Ask the AI for those rules explicitly, then verify them.
- Spot-check two data points against your spreadsheet each time.
- Sometimes the honest chart is just one number.
Related reading
- Contact forms on static sites
- Theme tweaks with AI: child themes and safe edits
- Building a reading level checker for your writing with AI
Look at the last chart you shared. Would it still make the same point with the axis starting at zero?