When clicked

If you select the On click option as the Trigger, the behavior rule is only applied to the element if the user taps it or clicks on it with the mouse pointer.

Select the element that should listen to the mouse event in the Trigger Element dropdown.

To ensure that the user interaction is recognized correctly, the element should always be located on the top layer of the shape (that is, at the end of the SVG code) and cover any other SVG elements. The easiest way is to use a transparent rectangle or circle to create a suitable click area, which you can then use as the element for the animation rule. Set opacity to 0 and fill either not at all or to a valid color, but not to none, as this would disable the click handler.

Example

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns:html="http://www.w3.org/1999/xhtml" version="1.1" height="20px" width="60px" x="0px" y="0px">
  <rect id="Background" x="0" y="0" width="60" height="20" fill="#AAAAAA" />
  <text id="LiveValue" fill="#FFFFFF" anchor="middle" transform="matrix(1 0 0 1 30 15)"></text>
  <rect id="ClickArea" x="0" y="0" width="60" height="20" opacity="0" />
</svg>

Data point condition

If you define a data point condition in the same behavior rule, clicking is only triggered if a data point is placed on the behavior rule and the condition applies at the time of clicking.

Shape preview and mouse interactions

Shape behaviors involving mouse interactions cannot be tested in the shape preview directly. You’ll need to place the shape on a schematic, assign a data point to it and quit edit mode to test it.