Troubleshooting Charts¶
This page lists the messages and symptoms charts produce, with the cause and fix for each.
Messages¶
| Message | Cause | Fix |
|---|---|---|
Datamodel must produce at least one table in order to add a vizualization |
In the visualization gallery, "Skip Test & Continue" was selected before the new datamodel's query had been run | Select "Test (alt+enter)" on the query step, then "Next >>". See Creating a chart from a table |
This datamodel does not have any tables |
The datamodel chosen in the gallery has no output tables recorded, usually because it has never run | Run the datamodel once, then choose it again |
Can not create panels on transient datamodels |
The datamodel was created over MCP or from AmiScript and not committed | Commit it, such as with web_execute op=commitSession. See Letting people edit an agent's chart |
Operator '&&' not supported for String |
A condition, such as in a datamodel's query, compared with =, as in Symbol = "MSFT" AND ... |
Compare with ==: Symbol == "MSFT". Writing datamodel queries is covered in the Datamodels section |
WHERE clause must evaulate to boolean, not: String |
The same, with a single condition | Compare with == |
Unknown chartType '<type>'. Use one of: bar, hbar, line, scatter, area, pie, donut. |
web_create_chart was given a type it does not create, such as speedometer |
Use one of the types listed, or create the chart in the gallery |
Unsupported layer 'type' '<type>' - must be "Chart", "Radial", "Legend", or "Crosshair". |
web_add_chart_layer was given an unknown layer type |
Use Chart, Radial, Legend, Crosshair, or Annotation |
missing required parameter(s): __SESSIONID |
An MCP call did not name the session to act in | Find the session's ID with web_console op=sessions and pass it as __SESSIONID. See Overview |
panel id(s) [<title>] already exist in layout |
web_create_chart was given a title another panel already uses as its id |
Give the chart another title |
... needs TWO output tables ... |
web_create_chart_from_template was asked for a Sankey without a second table |
Pass the links table as dmTable2 |
init failed for panel <id> (...): key not found: colsCount |
A chart was imported as JSON without an axes list |
Add "axes":[{"side":"bottom"},{"side":"left"}] to the chart, then import it again |
Invalid value 'right' for property 'xAxis' ... Allowed: [bottom, top] |
A layer in JSON passed to an MCP tool, such as web_execute op=updatePanel, named a side its axis cannot have. "Export/Import Layer" drops such a value with no message |
Use bottom or top for xAxis, and left or right for yAxis |
Error in Options --> Where: return type must be boolean, not String |
A layer's "Where:" compares with =, as in Symbol = "MSFT" |
Compare with ==: Symbol == "MSFT" |
<layer>: Error in Axis --> X: return type must be a number, not String |
In the layer editor, a field that needs a number, such as a line layer's "X:", holds a text column. The message opens on "Apply" or "OK", not in render stats; "OK" closes the editor and the layer keeps its fields from before the edit | Map a numeric column to the field. For a line over bars, see Drawing a line over bars |
Argument mismatch: ChartPanel::toImagePng(Integer,Integer) ==> expecting Binary ChartPanel.toImagePng(Number, Number, Boolean) |
toImagePng was called with 2 arguments |
Pass the third, printBg: toImagePng(400, 300, false) |
A layer draws nothing¶
A layer that draws nothing is diagnosed from the chart's render stats, which report each layer's rows and the problem it hit.
- Read the chart's render stats: over MCP with
web_debugop=panelRenderStats, or withsession.getDevTools().getAllRenderStats()in the AMIDB Shell Tool, with "Run on this web session" selected. See Running a script. - Find the layer's
LAYERrow and read itsRowsandProblem. - Find the row below whose
Problemmatches, and apply its fix. - Check that the layer now draws, and that its
Problemis empty.
Render stats miss one case: a layer whose shape fields are left empty, such as an optional "Range 2:" on a bullet chart, reports its rows and no Problem but draws nothing. Check the layer's fields in Plot -> Edit Layers.
Problem |
Cause | Fix |
|---|---|---|
NO DATA: this layer built 0 rows. Its dm/dmTable may name a table the DataModel does not output, or the DataModel has not run. |
The layer's table gave it no rows. Besides the causes the message names, a "Where:" condition that matches no row gives the same message | Check the layer's "Data Model:" table, run the datamodel, and check its "Where:" |
NO DATA: this layer built 0 rows and has no dm binding, so it was never given a source table. |
The layer has no datamodel | Choose one on its "Data Model:" button. An annotation that draws at fixed values reports this too, and can be ignored if it draws |
Syntax error for <section> --> <field>: Unknown variable: <name> |
A field names a column the table does not have, or the datamodel has not yet run, so none of its columns are known | Check the column name in the field, or run the datamodel |
NO SERIES: the layer has no series, so nothing can be drawn. |
Reported for legends and crosshairs even when they work | Check the chart itself; for a legend or crosshair, this can be ignored |
A field expression that does not compile is accepted by setFormula in AmiScript, and shows only here. A layer of an unknown type in imported JSON is dropped without any message, so check that the chart has every layer expected.
Symptoms¶
The bars are in alphabetical order, not by value¶
A category axis sorts its categories alphabetically by default, whatever the order of the datamodel's rows. Set the axis's "Sub-Title Ordering:" to "Original": on a chart made in the gallery the bars then run smallest first, and "Ordering:" "Descending" reverses them. On a chart made over MCP, "Original" follows the rows instead, so sort them with an ORDER BY in the datamodel's query. See Ordering bars by value.
The first and last points are cut in half¶
An axis runs exactly from the first value to the last by default, so the shapes at each end are drawn half outside the plot, and their hidden halves give no hover readout. Widen the axis range past the data. See Stopping the first and last points being cut off.
"User select" cannot be selected in "Edit Axis"¶
"User select" is unavailable while "Axis Format Type:" is "Auto". Set the type to "Numeric" or "Date-Time" first. See Setting an axis range.
Dates show the day before, at 20:00¶
Dates are shown in the user's time zone, by default EST5EDT, so a date stored at midnight UTC shows the evening before. Store dates at midnight in the users' zone, or set the user's time zone in Account -> My Settings.... See Dates on an axis.
Nothing shows when pointing at a candlestick¶
Templates do not fill in hover text, except "Calendar". Write it in the body layer's "Hover Over:" field, or turn on the crosshair. See Writing hover text.
Hover text is on one line, or numbers lose their zeros¶
Hover text is HTML: break lines with <br>, not \n, and format numbers with formatNumber, such as formatNumber(Open, "0.00", ""). See Writing hover text.
Every slice of a donut is the same size¶
The "Donut" template puts "Slice size:" inside sum(...), which draws every slice the same size when each row is one slice. In Plot -> Edit Layers, change the layer's "ANGLE STACK" "Stack On:" to the plain column, such as Qty. See Radial charts.
A pie or donut has no hole¶
A pie layer's "Inner Radius:" shows only with "Auto Min Value:" unticked. A new pie layer, and a donut created over MCP, have it ticked. Untick it in Plot -> Edit Layers, or set "autoMinValue" to false over MCP. See Pie and radial fields.
The crosshair shows the wrong bar¶
On a bar chart, the snapping crosshair stops after the second bar, and with "Free floating (follow cursor)" on, its box shows the bar to the right of the one under the pointer. Read bar values from the layer's hover text instead. See How the crosshair behaves.
Nothing on the chart can be selected, and onSelected never runs¶
A chart created in the gallery leaves its layers' "User Selectable:" empty. Set it to true. See Making a layer selectable.
The chart has no title¶
The default style hides chart titles with a font size of 0. See Showing a chart's title.
A legend or crosshair added by an agent shows nothing¶
A legend or crosshair added with web_add_chart_layer starts with no layer selected. Add a legend with "zpositions": [0], or select the layers under the legend's "AVAILABLE SERIES" or the crosshair's "SERIES TO SNAP TO". See Adding a layer.
An agent's chart cannot be edited¶
A chart created over MCP is transient, and its "Plot" submenu offers only "Remove" until it is committed. Commit it, with its datamodel, with web_execute op=commitSession. See Letting people edit an agent's chart.
A reference line or an image is not drawn¶
An annotation outside the axis's range is not drawn, and the axis does not widen to include it; an image whose source cannot be loaded draws nothing. Neither is reported. Set the axis range to include the annotation, and check the image's address. See Adding a reference line.
The legend is very long¶
A legend lists one entry per series per layer, and a bar chart colored by series makes each category a series. See Keeping a legend short.
The chart does not change when the table does¶
A datamodel that runs on startup, the gallery's default, does not rerun when its table changes. Subscribe it to the table. See Charts that update live.
Points in the middle of a gradient are almost invisible¶
The default "Gradient Colors" pass through the plot's background color. Use "Custom Gradient" and change the middle stop of its gradient to a color that stands out, or choose another "Gradient Colors" in the chart's style. See Color modes.
toImagePng returns null¶
A width and height of 0 stop the script, so it returns null; the session's Logger records "Thrown: Width (0) and height (0) cannot be <= 0". Pass a positive size, or null for both to use the chart's size on screen.
Rendering properties¶
Charts are drawn by the Web in batches, on a pool of threads. These properties tune that, and so chart performance, for charts with very many points. They are set in the Web's config/local.properties, and the defaults below are those built into the Web.
ami.chart.threading.suggestedPointsPerThread
- Default:
- Description:
-
- The number of points drawn in one batch.
ami.chart.threading.maxThreadsPerLayer
- Default:
- Description:
-
- The most batches one layer is split into.
ami.chart.threading.antialiasCutoff
- Default:
- Description:
-
- Shapes are smoothed (antialiased) only when a layer has fewer than this many.
- Default:
- Description:
-
- PNG compression,
0-10.
- PNG compression,
Known issues¶
These issues are present in the current release:
- With "Axis Format Type:" set to "Date", "Date-Time", or "Custom", ticks are placed from midnight UTC but labeled in the user's time zone. West of UTC, a label can read a day early or repeat, and the automatic minimum falls on the day before the first date. "Auto" places each date under its own day.
- On a bar chart, a crosshair set to snap follows the pointer to the second bar and then stops. "Free floating (follow cursor)" follows the pointer correctly.
- "Move Layer To Front", "To Back", "Forward", and "Backward" move a layer the opposite way. The layer at the top of the "LAYERS" list draws in front.
- In "Edit Style", "Export/Import" fails with "Frontend encountered unhandled condition."
- The Donut template sets "Slice size:" to a sum, so with one row per slice every slice is drawn the same size. A plain column draws the slices in proportion.
- A pie layer's "Inner Radius:" is hidden while "Auto Min Value:" is ticked, which is the default. Donuts created by an AI agent leave it ticked and draw as full pies.
- The Bump template draws rank 1 at the bottom of the chart.
- Changing a field in the chart gallery leaves the axis title and hover text built from the column chosen first.
- With the axis "Ordering:" set to "Original", "Order By:" orders the categories only when it is a single aggregate, such as
sum(Qty). A plain column or any other formula leaves them in row order. - Exporting a chart to a PNG image from AmiScript draws axis labels rotated and clipped, can add a "12/31/1969" tick to a date axis, and at a size other than the on-screen size draws the chart cut off or in a corner.
- A chart created by an AI agent can draw nothing until its datamodel runs again, although its render stats report rows.
- A crosshair or legend added by an AI agent with only an id and type has no series selected, and draws nothing until series are selected in its editor.
- A Sankey chart created by an AI agent draws its ribbons half a stage to the left of one created in the chart gallery from the same rows.