MAS 9.2 series reference
Every picture on this page comes from our Components Explorer, on our test system of the MAS 9.2 series. The charts read small lists that are part of the app, so the pictures need no data from Maximo. The counts come from the source of the apps that IBM ships with that series.
A chart in six lines#
A chart is the element <chart>. A bar chart needs a type, a datasource and two axes:
<chart id="fs_d_charts_bar" type="bar" datasource="fs_d_charts_ds_status" height="240px">
<chart-axis id="fs_d_charts_bar_abottom" position="bottom" data-field="wostatus" title="Status"/>
<chart-axis id="fs_d_charts_bar_astart" position="start" data-field="wocount" title="Work orders" scale-type="linear"/>
<chart-legend id="fs_d_charts_bar_l" position="bottom" enabled="false"/>
</chart>Our page has two more attributes on the element, for a click, and we leave them out here. The datasource behind the chart is a list of four rows, each with a status and a number. On a dashboard the same chart is a tile, <dashboard-chart-tile>, and the type is its attribute chart-type. Anatomy of a MAF Dashboard shows such tiles.
The nine types, and how often IBM uses each#
We counted the charts in the source of IBM’s shipped apps, as pages and as dashboard tiles:
| Type | What it is for | Charts in IBM’s apps |
|---|---|---|
line | a value over time | 24 |
donut | parts of a whole, with the total in the middle | 14 |
bar | a measure across categories | 10 |
stacked-bar | a measure split into parts, per category | 8 |
grouped-bar | several measures side by side, per category | 4 |
scatter | two measures against each other, one point per record | 4 |
area | a line with the space below it filled | 3 |
circle-pack | circles inside circles: a hierarchy with sizes | 1 |
pie | parts of a whole | 0 |
The 56 apps that IBM ships with the MAS 9.2 series: 68 charts in ten apps, 55 of them as dashboard tiles and 13 as the element <chart>.
Three things stand out. A third of all charts are lines. One app, with the id RELENGINEER, holds 32 of the 68. And pie is the type nobody uses: the framework draws it, and none of the 56 apps has one.
bar#

One bar per row of the datasource. It is the plain answer to “how many of each”.
line#

One point per row, joined in the order of the rows. With a group column, each group becomes a line of its own.
area#

The same data as the line, with weight. It suits one series whose volume matters.
stacked-bar#

Three columns of the datasource do the work: the category, the group and the value. The parts of a bar add up, so the bar shows the total too.
grouped-bar#

The same three columns as the stacked bar. The bars stand side by side, which makes the parts easy to compare and hides the total.
donut#

The ring leaves room for a number. The chart adds up the values and prints the sum in the middle, with a label that you set.
pie#

The pie works like the donut and has no middle. In our pictures its legend needed more room than the chart had: we gave the pie 300 pixels of height where the bar has 240.
scatter#

Both axes are numbers. Each row is a point, and the group column gives the colour.
circle-pack#

The rows have children: each large circle is a row, and the small circles are its children with their values. We set an option that says how deep it draws.
On a wide screen#

A chart takes the width it gets. The bars and the lines spread out. The round charts do not grow with the width, and they sit at the start of the space. Nine Chart Types on a Phone shows that case and the option that moves them to the middle.
Seven variants, one change each#
A chart has four kinds of children: <chart-axis>, <chart-legend>, <chart-toolbar> and <chart-option>. The first three have attributes of their own. The fourth passes a named option to the chart library behind the framework, Carbon Charts. Each picture below changes one thing.
No toolbar#

Every chart has three icons at its top by default: a table, a full screen view and a menu. <chart-toolbar enabled="false"/> takes them away.
The categories at the side#

The two axes changed places. The axis at the start holds the categories with scale-type="labels", and the axis at the bottom holds the numbers. The bars lie down, which leaves room for long names.
Two series, own colours, a curve#

The datasource has twelve rows, six for each series. The option data.groupMapsTo names the column that tells them apart. The option color gives each group its colour, and curve rounds the lines.
Two series in an area chart#

The two areas lie over each other. We also set stacked="true" on the number axis, as on the stacked bar, and the areas did not add up.
The donut in the middle#

The option donut.alignment with the value center moves the ring to the middle. The colours follow the names of the groups.
The pie in the middle, the legend at the top#

The pie has an option of its own, pie.alignment. The legend moved to the top with position="top" on <chart-legend>.
The stacked bar in own colours#

The same color option as on the line. It maps a name of a group to a colour.
The table behind every chart#

The first icon of the toolbar opens the numbers of the chart as a table. Below the rows, the table has a button to download them as CSV. The toolbar comes with every chart and needs no code.
Which type to pick#
- A trend over time:
line. Takeareafor one series whose volume matters. - Categories:
bar. Put the categories at the side when their names are long. - Parts of a total, per category:
stacked-bar. Takegrouped-barwhen the parts are to be compared and the total does not matter. - Parts of one whole:
donut, with the total in the middle. With many segments, we take a bar chart. - A click that has to do something: check the type first. Two Chart Types That Did Not Answer a Click names the two that stay silent.
What to read next#
Charts Work in Maximo Mobile. Nobody Ships One. puts the charts into a mobile app. Maximo-Datasource vs. JSON-Datasource explains the kind of datasource behind these pictures.
IBM documents <chart>, <chart-axis>, <chart-legend>, <chart-toolbar> and <chart-option> in the product itself, in the Application Configuration application under Component Documentation. The options that <chart-option> passes on are described in the documentation of Carbon Charts.
