MAS 9.2 series charts
We measured this on our test system, on the MAS 9.2 series, in the browser preview of our Components Explorer at the width of a phone. Each tap was a real pointer event on a point that the browser itself assigned to the mark.
The attribute#
A chart names a method of the controller in on-segment-click, and it can pass a value with on-segment-click-arg:
<chart id="fs_d_charts_bar" type="bar" datasource="fs_d_charts_ds_status" height="240px"
on-segment-click="chartClick"
on-segment-click-arg="{{'chart': 'bar', 'event': event}}">These are the first lines of the element on our page. The page has nine charts, one of each type, and every chart names the same method. The method writes the type into a state, and a label shows which types have answered:
chartClick(arg) {
const type = (arg && arg.chart) || 'unknown';
const seen = this.seen || (this.seen = []);
if (!seen.includes(type)) seen.push(type);
this.page.state.clicks = seen.join(', ');
}The block is shortened by one line that shows what the event carries.
The test#
We tapped one mark in each chart, one chart after the other: a bar, a point of a line, a slice, a circle.
| Type | What we tapped | Did the handler run? |
|---|---|---|
bar | a bar | yes |
line | a point of the line | yes |
stacked-bar | a part of a bar | yes |
grouped-bar | a bar | yes |
donut | a segment of the ring | yes |
pie | a slice | yes |
circle-pack | a small circle | yes |
area | a point of the line above the area | no |
scatter | a point, and then another one | no |

Seven types are in the list. area and scatter are missing.
What silence looks like#

Nothing marks these two as different. The build accepts the attribute on them, in the browser build and in the strict mobile build. Both charts draw as they should. A tap on a point of the scatter chart even showed the tooltip of that point. Our handler did not run, the console got no new line, and no message appeared.
For a developer this is the costly kind of fault. The code is right, the markup is right, and the feature does not work. The first place to search is the own controller, and we found nothing wrong there.
What we can say about the reason#
From the outside we can say three things about our page.
- Round points are not the reason. A line chart draws round points, and so does a scatter chart. On the line chart a tap on a point runs the handler.

- The data is not the reason. The line chart and the area chart on our page read the same datasource.
- The method is not the reason. It is the same method for all nine charts.
What is left is the chart type itself. We could not find a cause in our own markup or in our controller.
What to do#
| You want | Use |
|---|---|
| a tap on a trend over time | line. It looks like the area chart without the fill, and its points answer. |
| a tap on parts of a whole | donut or pie |
| a tap on categories | bar, stacked-bar or grouped-bar |
| an area chart or a scatter chart with a tap | a button or a list beside the chart, for the choice that the tap would have made |
And one habit: test the tap on every chart type you use, on the release you ship on. Our result belongs to one release, so test again after an update.
Check it yourself#
- Put
on-segment-click="chartClick"on an area chart and on a bar chart of the same page. - Let
chartClickwrite a line to the console. - Tap a bar, and then a point of the area chart.
- Count the lines in the console.
What to read next#
Every Chart Type in the Maximo Application Framework shows all nine types. Event Handling Patterns says what a handler receives, and Error Handling Basics lists the other faults that reach nobody.
IBM documents the attributes on-segment-click and on-segment-click-arg of <chart> in the product itself, in the Application Configuration application under Component Documentation.
