How AI picks chart types: the logic explained
When an analytics tool shows your data as a line rather than a bar, there is a rule behind it. Here are the rules chart recommendation systems use, how clariBI picks charts from the calculation behind an answer, and when to override.
When an analytics tool draws your data as a line chart instead of a bar chart, it is not guessing. Chart recommendation follows fairly simple rules. Knowing them helps in two ways: you can predict what you will get, and you know when to ask for something else.
What a recommender looks at
Most chart recommendation systems weigh the same inputs:
- Data types. Is each column a number, a category (text), a date or a location?
- How many columns are in the result: one number, one number per category, two numbers per item?
- Cardinality. How many distinct values does a category have: 4 regions or 4,000 customers?
- Volume. 12 monthly points or 50,000 daily rows?
- Intent. Is the question about change over time, ranking, share of a whole, spread or relationship?
The first four can be read straight from the data. Intent comes from the question, and that is where language models help.
The core rules
A date and a number: line chart
If one axis is time and the other a measure, a line is the default. Lines imply continuity, which is what a time series is. Refinements a good system applies:
- With only 2 or 3 time points, bars are often clearer.
- With many series (say ten products over 12 months), overlapping lines become unreadable. Show the top few, or split into small multiples.
- For volume over time, an area chart works; for comparing two specific periods, see the waterfall below.
A category and a number: bar chart
Revenue by region, tickets by team, spend by channel: bars. Sort them by value unless the categories have a natural order (age bands, satisfaction scores 1 to 5, weekdays). Use horizontal bars when labels are long.
Parts of a whole: pie, with limits
"What share of revenue comes from each channel?" is a composition question. A pie chart can work with 2 to 5 slices. With more, people cannot compare angles reliably, and a sorted bar chart or a treemap is better.
Two numbers per item: scatter plot
"Ad spend against conversions by campaign" has two measures and no time axis. Each point is one campaign. A third measure can become point size (a bubble chart). With thousands of points, overplotting hides the pattern, so sampling or a heatmap helps.
How values are spread: histogram
"What is the distribution of order sizes?" calls for a histogram. To compare spreads across groups, a box plot per group.
One number: metric card or gauge
"Total revenue last month" returns a single value. Show it large, with a comparison to the previous period or a target. A gauge suits a value against a known maximum.
Location: map
Countries or regions with a value per region suit a choropleth map. Only use it when geography matters to the question; a bar chart ranks regions more precisely.
How clariBI chooses
clariBI applies these rules through the calculation rather than by inspecting the question text alone. When you ask a question, a planner decides which calculations answer it, and code runs them on your data. Each calculation has a natural chart:
| Calculation | Default chart |
|---|---|
| A total or average | Gauge or metric value |
| A value over time | Line |
| Top or bottom items by a value | Bar |
| This period against the previous one | Waterfall (period A, the change, period B) |
| Two numeric columns against each other | Scatter |
| Many numeric columns against each other | Correlation matrix |
| How often each value occurs | Histogram |
That default is a suggestion, not a rule. The model that writes the answer can pick another standard type when the question calls for it: "which products sell most" can become a pie or funnel if that fits, "how has revenue changed" can become an area chart. clariBI also checks the data behind each chart against the fields that chart type needs (a line needs labels and a series, a scatter needs points), and if you ask for a chart the calculated data cannot fill, the answer may come back as one of the standard types instead.
clariBI picks from eleven types on its own: gauge, bar, pie, funnel, radar, line, area, waterfall, histogram, scatter and correlation matrix. Others, such as heatmaps, treemaps, Sankey diagrams, maps and tables, are used when a template specifies them or when you ask. The chart recommendation docs list them all.
For AI dashboards, clariBI looks at the columns of the sources you picked (their type, number of distinct values and dates) to recommend up to 15 widgets, and you keep the ones you want.
There is no confidence score for chart fit. To judge a chart, click a bar or point: the drill-down panel shows the dataset, the date range, how many rows were aggregated and the items behind the value. The help article on how the AI chooses charts walks through it.
Where automatic choice goes wrong
It does not know your audience. An executive may need one metric card where an analyst wants a scatter plot. The data is the same.
It does not know your story. A stacked bar stresses composition, a line stresses trend, a table stresses exact values. Which matters depends on the point you are making.
It sees one chart at a time. On a dashboard, charts sit next to each other. Consistent axes and a sensible mix of types are a human decision.
Similar columns confuse it. If amount and total_amount both exist, the chart may be correct for the wrong column.
When to override
- Ask for a table when the reader needs exact numbers.
- Ask for a simpler chart when you get something exotic. A bar chart beats a radar chart for almost every business audience.
- Ask for the top 10 when a pie has too many slices.
- Ask for bars when a line connects categories that have no order.
- Keep the default when the data type clearly matches: time with a line, categories with bars.
In clariBI you override by saying so, in the question or a follow-up: "Show monthly revenue for 2025 as a bar chart", "Table of the 20 largest customers by revenue", "Scatter plot of price against units sold". In the Dashboard Builder you can set each metric's visualization type yourself; the guide to widget types helps you pick.
For the mistakes that survive a correct chart type, such as truncated axes, color-only meaning and cherry-picked ranges, see 10 data visualization mistakes to avoid.
Try it on one of your own questions: ask it once without naming a chart, then again with the chart you would have drawn by hand, and see which one your team reads faster.