Skip to content
Web > Charts > Chart Type Walkthroughs > Cartesian

Combo Chart of Volume and Fill Rate

Known issues

Some chart features have known issues in the current release. See Known issues.

This walkthrough draws monthly volume as bars and the fill rate as a line on a second axis, answering "Does the fill rate fall when volume rises?"

Prerequisites

  • Editor mode: click once on the screen, then press Ctrl+d. The AMIDB Shell Tool and the gallery are used as in the quickstart.
  • Data: the example data that stage 1 creates. To use a table of your own instead, see With your own data.

1. Create the example data

The chart reads a table in the Center, so create the table first.

  1. Select Dashboard -> AMIDB Shell Tool....
  2. Run:

    1
    2
    3
    4
    CREATE PUBLIC TABLE ChartDemoMonthly (Month String, Volume Long, FillRate Double);
    INSERT INTO ChartDemoMonthly VALUES ("2026-05", 1200, 0.91), ("2026-06", 1450, 0.88), ("2026-07", 990, 0.94),
     ("2026-08", 1610, 0.86), ("2026-09", 1380, 0.90), ("2026-10", 1720, 0.84);
    SELECT * FROM ChartDemoMonthly;
    
  3. Check that the lower pane shows the 6 rows.

2. Create the chart

The gallery creates a datamodel that reads the table, then places the chart.

  1. Select Windows -> New Window, then the edit button on Blank1, then "Create Table / Visualization / Form".
  2. Select "AMI (__AMI)", then "Next >>".
  3. Select the "USER" tile ChartDemoMonthly, then "Next >>".
  4. Select "Test (alt+enter)", then "Next >>".
  5. Select the "Cartesian" tab, then the "Combo" tile.
  6. Set the fields below the tiles:

    Field Value
    "Category:" Month
    "Bars:" Volume
    "Line:" FillRate
  7. Select "Finish".

  8. Check that the window shows 6 bars, 2026-05 to 2026-10, and a line whose scale, 0.84 to 0.94, is on the right.

Result

6 bars on the left axis, from 0 to about 1,800, and a line on the right axis, from 0.84 to 0.94. The months with the most volume have the lowest fill rate.

The finished "Combo" chart: 6 bars on the left axis, from 0 to about 1,800, and a line on the right axis, from 0.84 to 0.94. The months with the most volume have the lowest fill rate

The chart's own PNG export, from AmiScript toImagePng; see Chart type walkthroughs.

To check without looking, read the render stats: session.getDevTools().getAllRenderStats() in the AMIDB Shell Tool, with "Run on this web session" selected (see Running a script), or web_debug op=panelRenderStats over MCP. The "Bars" and "Line" layers each report Rows 6 and an empty Problem, and a RIGHT axis appears.

With your own data

The chart needs one row per category: a text column, a number for the bars, and a number for the line. In stage 2, select the "USER" tile of your table in place of ChartDemoMonthly, and map your columns to the fields in stage 2's field table. Stage 2's check quotes the example data; on yours, check the same features against your own values. To filter rows, or to total raw rows first, see Using your own data.

Over MCP

An agent builds the same chart from the same table. Connecting an agent is covered in the AI section; the tools are on Building charts over MCP.

  1. Create the datamodel with web_execute op=importDatamodel and this dmJson, then run it once with op=initDatamodelSchema and dmName ChartDemoMonthly:

    {"id": "ChartDemoMonthly", "queryMode": "startup", "callbacks": [{"name": "onProcess", "amiscript": ["{ CREATE TABLE ChartDemoMonthly AS USE ds=\"AMI\" EXECUTE SELECT * FROM ChartDemoMonthly; }"]}]}
    
  2. Create the chart:

    {"windowName": "ChartDemoCombo", "templateKey": "tplCombo", "datamodelId": "ChartDemoMonthly", "dmTable": "ChartDemoMonthly", "title": "ChartDemoCombo", "bindings": "{\"CAT\": \"Month\", \"BARS\": \"Volume\", \"LINE\": \"FillRate\"}"}
    
  3. Run the datamodel again with web_execute op=executeDatamodel, dmName ChartDemoMonthly. A chart created over MCP can stay empty until its datamodel runs again, with its axes at 0-100.

  4. Confirm that every layer reports the rows above and an empty Problem: run web_debug op=panelRenderStats.

The call is web_create_chart_from_template.

Removing the example

Remove the chart, then its datamodel, then the table, so that the next walkthrough can reuse the names:

  1. Close the chart's window with its close button, and select "Delete" when asked whether to delete the panel.
  2. Select Dashboard -> Data Modeler..., expand "Datamodels", right-click the chart's datamodel, ChartDemoMonthly, and select "Delete Datamodel", then "Yes". If that name was taken when stage 2 ran, the gallery added a number to it, as in ChartDemoMonthly1.
  3. Run DROP TABLE ChartDemoMonthly; in the AMIDB Shell Tool.
  4. Check that SELECT * FROM ChartDemoMonthly; reports Unknown table: ChartDemoMonthly.

Over MCP, delete the chart with web_danger op=deletePanel, then the datamodel with op=deleteDatamodel, dmName ChartDemoMonthly, and drop the table as in step 3. deleteDatamodel refuses a datamodel that has been committed; delete that one in the Data Modeler as in step 2. See Removing an agent's chart.