| Search Locate Previous Next | Contents |
This section of the User Guide describes the interactive capabilities now available in RainPro. These allow you to change many of the chart elements dynamically (for example headings or titles), to implement drill-down capabilities, or to write truly interactive charts where the user can modify data values.
The RainPro workspace includes two examples for you to copy:
Drill shows a simple data exploration tool where you can click on pie sectors to see the detail as a barchart
Edit shows how to edit the data values on a simple linechart
You can also check out the callbacks in the RawGui function:
Sample RawGui PG
These illustrate the techniques which you can use to detect the chart elements clicked by the user, modify headings, offer hints on mouse-move etc.
The functions which you may need to call are:
EnumerateCharts obj List all charts drawn on this object
FindInfo Locate hotspot info by tag (e.g. Heading)
GuiId Return Guiname associated with this chart/tag
D2L Convert Device to Logical co-ordinates
L2D Convert Logical to Device co-ordinates
FindHotspot Hotspot which is pointed to by (x,y) coordinates
FindSeries Series data which is within tolerance of the coordinates
FindPoints Data points which lie within bounding box
FindHint Hint which matches this chart/series/data index
SetObject Reset heading or axis captions in-place
GetPage Recover updated PostScript source
These are all illustrated by the examples in the RainPro workspace.
N.B. RainPro is shipped with only the data hotspots enabled. FindSeries will work as described, but FindHotspot will not detect any captions, headings and so on. You can only change this setting at initialisation (before you call ch.Set for the first time after you last called ch.Close):
ch.SetDefault 'HO' 2 © all hotspots operative ch.SetDefault 'HO' 0 © no hotspots at all
This is probably best run in an initialisation function in your workspace.