Search Locate Previous Contents

COBJ – mouse click on chart object

A COBJ event is reported when the user clicks on any item of chart boilerplate such as the main heading, axis labels, keys and so on.

The message will report:

  1. chart id (string) e.g. ‘chart9876513’
  2. series id (string) e.g. ‘usage’ or null if you don’t set it
  3. hotspot id (string) e.g. ‘Heading’
  4. counter (integer, from 1) for multiple hotspots like axis labels
  5. bounding-box of hotspot rectangle in twips
  6. mouse button pressed
  7. keyboard state (shift,ctrl,alt = 1 2 4)

You could use this to enable a simple ‘point and grunt’ interface to allow users to right-click on various chart elements to change colours, fonts etc.

If hotspots overlap, only the last one drawn is returned.

Hotspot types

Heading ... The main chart heading
Subhead ... The subsidiary heading
Footnote ... The chart footer
Pagelabels ... The page-label array
XCaption ... The X-axis caption
YCaption ... The Y-axis caption
XLabels ... The set of all X-axis labels
YLabels ... The set of all Y-axis labels
Key ... The set of chart keys.

Note that for labels and keys, the hotspot counter is incremented for each label, working out from the origin. For barcharts and piecharts, this may be used to identify the row in the data matrix corresponding to the label the user clicked on.

You might use the bounding area to show a dotted rectangle (indicating the selected object) when the user clicked on it, or to make a locator of the appropriate size for ‘drag-drop’ processing.

See also ...
HotspotSupport – viewer events


© Copyright Causeway Graphical Systems Ltd 2003