Search Locate Previous Next Contents

PostScrp.FindHotspot – chart headings etc.

This function is intended to be used to allow users to modify ‘boilerplate’ elements such as headings and axis captions directly, probably by using a right-mouse menu. It takes the name of the APL Gui object on the left and the mouse position (x,y) on the right, and reports the hotspot (if any) which the (x,y) location falls within.

xy„²2†2‡msg      © Mouse position
info„'#.pgi'#.PostScrp.FindHotspot xy

The result is a null vector if no hotspot is detected, otherwise it is an 8­element vector giving:

  1. The chart name (set by ch.Name or generated by RainPro)
  2. The hotspot type (see the list below)
  3. The internal gui name of the APL object
  4. The hotspot counter (=1 except for pagelabels, labels and keys)
  5. The bounding box of the marked area

For example if you generate the Sample chart, view it with RawGui PG and double-click on the barchart heading:

Sample Barchart  Heading  gui-object-name  1 54.86 118.82 154.86 140.42

If hotspots overlap, only the last one 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 (series marker and text)
Keytext ... The key text only.

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. The key text has a set of zero-size hotspots, so it cannot signal any events but it may be changed in-place under program control.

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.

Note that RainPro is shipped with support for text hotspots disabled to save on processing time and workspace. To enable these, you must run:

ch.SetDefault 'HO' 2  © all hotspots operative

before your first call to ch.Set following a previous ch.Close.

More hotspots may be added in future releases.


Continue to: PostScrp.FindSeries – detect data series
© Copyright Causeway Graphical Systems Ltd 2003