Graph widget

Use the graph widget for line, bar, pie and polar graphs of data in your dashboards.

This widget is intended for 'standard'/generic graphing. For market data price charts use the Chart widget, for more exotic financial outputs use other type-specific widgets such as the GEX widget.

example widget

The graph API is straightforward, and aims to be familiar to people already comfortable with tools like matplotlib or plotly.

Properties

Ref Default Notes
type [null] Graph type, one of pie, line, bar, polar, radar, hbar, stack, hstack
legend white Legend position, one of auto, top, left, right, bottom, none
worksheet [null] Data to plot on the graph (see below)

Worksheet

The graph widget works by accepting a Worksheet structure, which is analagous to a Dataframe in other platforms/languages except for the following differences:

  1. Worksheets hold numeric data only
  2. Worksheets more explicitly model the concepts of series and data points
  3. Worksheets support additional metadata, e.g. series colors and data point colors

The graph data is set/updated by pushing a worksheet to the worksheet property. This property accepts either a JSON-serialized worksheet structure, or CSV data that can be parsed into a worksheet structure.

See the Worksheet docs for details on accepted formats.

Graph types

The graph type is set by pushing a string indicating the type required to the type property. Examples of the graph types can be seen in the Graph types documentation.

Examples

A simple line graph

Here we echo a string of data, and pipe it in to the awts dash widget graph command with the --stdin argument for accepting worksheet data on stdin:

❯ echo "bar,1,2,3,4,9" | awts dash widget graph /primary/page1/graph/worksheet bar --stdin
Sending to dash...
Ok

example widget