Chuyển tới nội dung chính

Charts

A chart is a saved question about a dataset: which dimensions to group by, which metrics to measure, how to draw the result. Charts are the building blocks of dashboards, and they can be sent on a schedule by a subscription.

The Charts list with its toolbar, search box, type filter and the chart rows

Egret has 19 chart types. This section documents the Charts page, the editor you build charts in, and one page per chart type with every setting in the order the editor shows it.

The Charts list​

Go to Explore → Charts. The list shows one row per chart with its Name, Type and when it was Updated. A star in front of the name marks a bookmark. A summary line above the table counts the charts (and folders) that match the current filters.

ControlWhat it does
Search charts…Matches the chart name or its type name, as you type.
TypeFilters to one chart type. The menu lists only the types you have at least one chart of.
Name, Type, Updated headersClick to sort. The default is Updated, newest first. Click again to reverse.
Star toolbar button (Bookmarks)Shows only bookmarked charts.
Checklist toolbar button (Bulk select)Adds a checkbox to every row. Select charts, then move them to a folder or Move N to Trash. It appears once at least one chart exists.
Trash toolbar button (Trash)Switches the page to the Trash view (see Trash).
Folder toolbar button (New folder)Creates a folder. Folder names are free text.
+ ChartStarts a new chart.

The star beside a chart name toggles its bookmark. Bookmarks belong to you, not to the workspace.

Row actions​

The ⋯ menu at the end of a row offers:

  • Open: the same as clicking the name.
  • Duplicate: creates a copy named name (copy) in the same workspace, and shows a Duplicated toast.
  • Move to "folder": one item per folder, disabled for the folder the chart is already in. Remove from folder appears for a chart that is in a folder.
  • Move to new folder…: asks for a name, creates the folder and moves the chart into it.
  • Share…: opens the sharing dialog for the chart.
  • Subscribe…: opens a new Alerts & Reports report with this chart already chosen as its target.
  • Move to Trash: asks first (Move to Trash?, "name" moves to the Trash. You can restore it from there.); press Move to Trash to confirm.

Folders​

Press the folder toolbar button (New folder) to create a folder; the dialog asks for a name. Once you have a folder, the list is grouped into collapsible sections: the folders in alphabetical order, then Uncategorized. Each header shows the number of charts in the section and a ⋯ menu to share, rename or delete the folder. Drag a row onto a folder header, or use the row menu, to move a chart. Deleting a folder does not delete its charts: they move to Uncategorized. Delete asks first (Delete folder?); the dialog names the folder and says how many charts move ("The 6 charts in it move to Uncategorized; none is deleted.") or that it is empty. Press Delete folder to confirm.

The Charts list grouped into the folders Chart gallery and KPIs, then Uncategorized, with the row menu of a chart open on its folder commands

While a search, type filter or bookmark filter is active, the sections stay, but folders with no matching chart are hidden.

Bulk select​

The checklist toolbar button turns on a checkbox column. Tick charts (the header checkbox selects every visible row), then use Move n to folder… or Move n to Trash next to the Type filter. Collapsed folders are not included in select all. Move n to Trash asks first ("2 charts move to the Trash. You can restore them from there.").

Bulk select with two charts in the KPIs folder selected and the Move 2 to folder… and Move 2 to Trash buttons

Trash​

Move to Trash is reversible. The trash toolbar button switches the page to the Trash view, with its own search box. Each trashed chart has Restore and Delete permanently in its menu. The Trash view has no folders, bookmarks or bulk select, and its summary counts only the trashed charts (1 chart), not the folders. + Chart is not shown there.

The Trash view with one trashed chart and its Restore and Delete permanently menu

Delete permanently cannot be undone, and asks you to type delete before the Delete button turns on.

The Delete permanently confirmation

Create a chart​

  1. Go to Explore → Charts and press + Chart. On an empty workspace the button is Create your first chart.
  2. On Choose a visualization, pick a chart type. Use Search chart types… to filter by name or description.
  3. In the editor, open the Data tab and pick a Dataset.
  4. Fill in the fields the preview asks for. The preview shows Set up your type with a hint such as Add: X-axis, a metric until the required fields are set.
  5. Press Save, enter a Name and an optional Description, and press Save again.

A new bar chart before any field is set: the preview asks for the missing fields

After saving, Egret opens the chart at its own address and the button on the toolbar changes from Save to Update. The chart's name and description are then edited on the toolbar itself.

You can also start from a dataset: the dataset's detail page has a Create chart button. See The chart editor for the editor layout, running queries, exporting and drilling.

The chart type gallery

Choose a chart type​

Every card in the gallery shows a name and a one-line description. Pick the one that fits the question.

You want toUse
Compare a metric across categoriesBar or Row (many categories, sorted)
Show a trend over timeLine or Area
Mix a count and an amount on one chartCombo
See how two metrics relate, optionally sized by a thirdScatter
Show each category's share of a totalPie
Show one headline numberBig number
Show one number against a targetProgress or Gauge
Show the latest value and its changeTrend
Show drop-off between stagesFunnel
Show how increases and decreases add upWaterfall
Show the spread of a value per categoryBox plot
Show flows from one category to anotherSankey
Shade regions or pin coordinates on a mapMap
List rows, or aggregate and sort themTable
Cross-tabulate rows against columns with totalsPivot Table
Read one record field by fieldObject detail

The rest of the section covers the settings that several types share:

Save and update​

On a new chart, Save on the editor toolbar opens the Save chart dialog with Name and Description; its Save creates the chart and moves you to its page.

The Save chart dialog with the name and description

On an existing chart, the name is the box at the top of the editor and the description is the line under it (placeholder Add a description). Update saves the chart in one step, with no dialog: the button reads Saving… while the request runs, then a Saved message appears. Saving overwrites the chart in place: there is no version history for charts.

Saving fails with a message in these cases:

MessageCause
Pick a datasetNo dataset is selected.
Name requiredThe Name field is empty or blank.
This chart needs …A required field for the type is missing, for example This chart needs X-axis and a metric.

If you change anything and try to close or reload the tab without saving, the browser shows its own "leave site?" prompt. Moving to another page inside Egret does not prompt.

ghi chú

Charts do not have a separate filter builder. Filters come from drilling into a chart: clicking a value and choosing Filter by … adds a filter chip above the chart, and the chip is saved with the chart. See The chart editor.

Create a chart through the API​

POST /api/ws/{workspace}/charts (Charts API) takes the chart's name, dataset_id, viz_type and a params object. The server checks the shape of params and answers 400 with a message naming the field when it is wrong:

  • params.version must be 2. A body without version is the old shape and is refused.
  • params.spec is the query: metrics, dimensions, columns, filters, orderby, row_limit (at least 1), rollup_groups and optionally temporal_units.
  • params.settings must be an object (it can be empty). It holds how the chart is drawn, including which column goes on which axis.

The axis mapping lives in settings, not in spec.dimensions. spec decides what the query returns; settings decides where the editor puts each returned column. A chart saved with only spec runs, but opens with an empty X-axis.

{
"dataset_id": "<dataset uuid>",
"name": "Revenue by region",
"description": "",
"viz_type": "bar",
"params": {
"version": 2,
"spec": {
"metrics": ["total_revenue"],
"dimensions": ["region"],
"columns": [],
"filters": [],
"orderby": [],
"row_limit": 1000,
"rollup_groups": []
},
"settings": {
"cartesian.xAxis": "region",
"cartesian.yMetrics": ["total_revenue"]
}
}
}

Settings keys are prefixed by the chart family. Bar, row, line, area, combo and scatter charts share the cartesian.* keys (cartesian.xAxis, cartesian.yMetrics, cartesian.series, cartesian.stacked, …); other types use their own, for example table.columns and table.metrics, pie.dimension and pie.metric, funnel.dimension and funnel.metric, pivot.rows, pivot.cols and pivot.metrics. The server does not check the keys, so an unknown key is kept as it is. The quickest way to get the exact keys for a type is to build the chart in the chart editor, save it, and read it back with GET /api/ws/{workspace}/charts/{id}. viz_type must be one of the 19 type names the editor lists (bar, line, pie, table, pivot_table, scalar, …); any other value is refused. Column and metric names in params are not checked when you save; an unknown name shows up when the chart runs.

Limits and known issues​

  • A chart returns at most 10,000 rows. Larger Row limit values are clamped.
  • A chart runs a single query against one dataset.
  • Chart types and settings that Egret does not have, compared to other BI tools, are listed on each type's page under Limits and known issues.

Further reading​