Skip to content
Web > Charts

Creating Charts

Known issues

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

Charts are created with the visualization gallery, the chart builder: a wizard that takes a datamodel's table, offers every chart type as a tile, and previews the chart from the data before it is placed.

Overview

The gallery opens from a blank panel, in Editor mode. It has up to 3 steps:

  1. Data: choose an existing datamodel, or a datasource and table to create one from.
  2. Query: for a new datamodel, run its query once so the gallery knows its columns.
  3. Chart: choose a tile, check the fields it maps from the columns, and select "Finish".

The chart replaces the blank panel. To create a blank panel, open a new window (Windows -> New Window) or split an existing panel; see Arranging an application.

Creating a chart from a table

This route creates the datamodel and the chart together, from a table in a datasource such as the Center.

  1. Select the edit button on a blank panel, then select "Create Table / Visualization / Form". A window titled "AMI Panel" opens on the "AMI Data Modeler" step.
  2. In the tree on the left, under "Datasources", select the datasource. The Center is "AMI (__AMI)". Then select "Next >>".
  3. On the "AMI Table Chooser" step, select the table's tile. Tables are marked "SYSTEM" or "USER", and selecting one shows its first 10 rows below. Use Ctrl+Click to select more than one table.
  4. Select "Next >>". A datamodel named after the table is created, and its editor opens with a query that reads the whole table:

    CREATE TABLE <table> AS EXECUTE SELECT * FROM <table> WHERE ${WHERE};
    

    Edit the query here to filter, group, or sort the rows before they reach the chart. Writing datamodel queries is covered in the Datamodels section.

  5. Select "Test (alt+enter)", and check that the "Schema" tab lists the output table and its columns.

  6. Select "Next >>". The gallery opens.
  7. Choose a tile and check its fields, as in Choosing a chart type, then select "Finish".
  8. Check that the chart has replaced the blank panel.

The test in step 5 is required. Selecting "Next >>" without it opens a "Confirm" window, "We recommend running a test before continuing. Run a test now?". Its "Skip Test & Continue" button stops with "Datamodel must produce at least one table in order to add a vizualization".

Creating a chart from an existing datamodel

This route charts the output of a datamodel the layout already has.

  1. Select the edit button on a blank panel, then select "Create Table / Visualization / Form".
  2. In the tree on the left, under "Datamodels", select the datamodel, then select "Next >>". The gallery opens.
  3. Choose a tile and check its fields, as in Choosing a chart type, then select "Finish".
  4. Check that the chart has replaced the blank panel.

The gallery needs to know the datamodel's columns. A datamodel whose output tables are not yet known, such as one that has never run, stops at step 2 with "This datamodel does not have any tables": run it once, then try again. A datamodel that has never run but already has its tables recorded, such as one saved in a layout, goes through. A datamodel created by an agent over MCP, or from AmiScript with session.importDatamodel, is transient: it exists only in the agent's session until it is committed. It must be committed first, or step 2 stops with "Can not create panels on transient datamodels". See Building charts over MCP.

Choosing a chart type

The gallery shows chart types as tiles on tabs, and previews the selected tile from the datamodel's data.

  1. Select a tab: "Cartesian", "Radial", or "Flow" for charts. The "Grid", "3D", "HTML", and "Plugins" tabs offer other panel types.
  2. Select a tile. Template tiles have a dashed border. The fields the tile maps appear below the tiles, filled in from the table's columns, and the "LIVE PREVIEW" area on the right draws the chart.
  3. Check each field and change any that is wrong. See Mapping columns to fields.
  4. Select "Finish". The chart replaces the blank panel.

Every tile, with its fields, is listed in Chart types.

Mapping columns to fields

Each tile maps columns of the table to named fields, such as "Category:" and "Value:" for a bar chart. The gallery fills them in from the columns' names and types, and each field has a "..." button for choosing or writing its value.

Check the mapping before selecting "Finish". A filled-in mapping can be valid and meaningless: on a table whose first numeric column is an id, a bar chart's "Value:" comes up as the sum of the ids, such as sum(ExecId). The preview draws it without complaint.

A field takes a column name or an expression over columns. For a bar chart, the gallery fills "Value:" with an aggregate of the column, such as sum(Qty). After changing a field, select "Apply" above the preview to redraw it.

On a date axis, the preview draws each point beside the previous day's label. The placed chart puts it under its own day.

For a Sankey chart, the gallery adds a "Links table:" field for the table holding the links. With a single-table datamodel it is filled with that table, and the Sankey draws empty axes. See Chart types.

Checking the data behind the preview

The preview area has 5 buttons: "View Data", "View Prepared", "Apply", "Reset", and "Clear".

"View Prepared" opens "Prepared Data", which shows the values each field produced for each row, in columns named for the field, such as "Options - Group By" and "Axis - X Groupings". With no rows, it shows only the column headings.

Customizing before placing

"Customize", below the field mapping, opens the full layer editor in the same window, with "← Chart types" to return to the tiles. The layer editor is described in Layers.

The layer editor may open on its "Advanced" tile, with the mapped fields spread across the advanced form. Select the tile of the chart type chosen in the gallery, such as "V Bar", to return to its simpler form with the mapping in place.

What the chart is called

The placed chart takes its panel id and title from its datamodel, so a chart created from the table Trades is the panel Trades. Change both in the chart's "Settings..." (see Colors and style). The title is set but hidden by the default style; see Showing a chart's title.

What this does not support

  • Transient datamodels: the gallery refuses a datamodel created over MCP or from AmiScript until it is committed, with "Can not create panels on transient datamodels".
  • Datamodels with no output: the gallery needs the datamodel's output table and columns, so a datamodel that has not run, or whose query produces no table, cannot be charted until it does.