SharpPlot Reference > SharpPlot Structures > HotspotInfo Struct

HotspotInfo Struct

This structure is used to pass details of chart hotspots between various utilities in the PageMap class. It is likely that a programmer will find it very helpful when debugging a Gui application to have the contents written to the console to check that the mouse really did hit the expected series item.

For advanced applications (for example graphical editing by dragging markers or bars) it holds the detail necessary for developing an appropriate Gui front end. For simple applications, it will identify which item in the data series the user clicked on, which could be used to drill to appropriate detail, or simply highlight the point.

public struct HotspotInfo

Example

  pm = sp.RenderPageMap();
  int hix = pm.FindHotspot(200,120);
  HotspotInfo hi = pm.GetHotspotInfo(hix);
  System.Console.WriteLine(hi.ToString());

Chart=Bar1, Series=Hats, Item=2, Shape=Bar, Locator=186.9 52 216 193.2 0

HotspotInfo Properties (all Readonly)

Chart
Name of chart (set by SetChartName or auto-generated) as a string
Series
Name of series (set by SetSeriesNames or auto-generated) as a string
Item
Index of selected data item (1-origin) in the series
Locator
Vector of doubles (depending on item shape) which define it on the page
Shape
HotspotType enumeration giving the item shape (HotspotType.None if no hotspot detected)

For a HotspotType.Marker, the Locator gives 6 numbers – the (x,y) location of the marker and of its immediate neighbours (or of itself again if it is the first or last of the set). For a HotspotType.Bar it gives the bounding box as (x,y,x,y) lower-left, top-right. For a HotspotType.Wedge it gives (x,y,innerradius,outerradius,startangle,endangle) where the angles measure in degrees anticlockwise from the 3:00 line. For a HotspotType.Segment it gives (origin x, origin y, destination x, destination y).

All text-based hotspots (headings, axis-labels) are HotspotType.Bar and have a bounding rectangle, so the user can click anywhere in the region containing the text.

Requirements

Namespace: Causeway

Assembly: SharpPlot (in sharpplot.dll)

See also ...

Active charts in GUI Applications | HotspotType Enumeration


Send comments on this topic
© Dyalog Ltd 2021