ChartInteractionController
public class ChartInteractionControllerBackend-neutral interaction controller shared by every chart host component
(ChartGuru.ChartComponent, ChartGuru.ChartGraphic,
ChartGuruElement). Consumes chart-space pointer positions (pixels,
bottom-left origin) and forwards them to a ChartGuru.ChartProxy, driving
the same selection, hover, drag-scroll and wheel-zoom behaviour that previously
lived inline in ChartGuru.ChartGraphic.
Hosts translate their native pointer types (uGUI PointerEventData, UI Toolkit
PointerDownEvent, etc.) into Vector2 chartPos + phase and call the
methods below. The controller stays UI-framework agnostic so the same logic is
reused across the three backends.
Properties
Section titled “Properties”
EnableSelection
Section titled “EnableSelection”public bool EnableSelection { get; set; }Allow the controller to toggle selection on pointer tap.
Returns
System.Boolean — No return description is available.
EnableHoverHighlight
Section titled “EnableHoverHighlight”public bool EnableHoverHighlight { get; set; }Allow the controller to update ChartGuru.Chart.HoveredIndex during pointer move.
Returns
System.Boolean — No return description is available.
EnableDragSelection
Section titled “EnableDragSelection”public bool EnableDragSelection { get; set; }Allow drag gestures inside the plot area to run a rubber-band selection.
Returns
System.Boolean — No return description is available.
EnableViewportDrag
Section titled “EnableViewportDrag”public bool EnableViewportDrag { get; set; }Allow drag gestures to scroll the viewport.
Returns
System.Boolean — No return description is available.
EnableViewportZoom
Section titled “EnableViewportZoom”public bool EnableViewportZoom { get; set; }Allow the scroll wheel to zoom the viewport.
Returns
System.Boolean — No return description is available.
ViewportZoomSensitivity
Section titled “ViewportZoomSensitivity”public float ViewportZoomSensitivity { get; set; }Multiplier applied to scroll delta when computing zoom factor.
Returns
System.Single — No return description is available.
Events
Section titled “Events”
DataPointClicked
Section titled “DataPointClicked”public event Action<int, DataPoint> DataPointClickedRaised when the user clicks on a mark and selection is enabled.
Returns
System.Action{System.Int32,ChartGuru.DataPoint} — No return description is available.
DataPointHovered
Section titled “DataPointHovered”public event Action<int, DataPoint> DataPointHoveredRaised when the user hovers a mark and hover-highlight is enabled.
Returns
System.Action{System.Int32,ChartGuru.DataPoint} — No return description is available.
HoverChanged
Section titled “HoverChanged”public event Action<int> HoverChangedRaised whenever the hovered-index changes. -1 when no hover.
Returns
System.Action{System.Int32} — No return description is available.
RenderRequested
Section titled “RenderRequested”public event Action RenderRequestedRaised by the controller when the chart needs to be re-rendered. Hosts should invalidate their surface.
Returns
System.Action — No return description is available.
Methods
Section titled “Methods”
Bind(Chart, ChartProxy)
Section titled “Bind(Chart, ChartProxy)”public void Bind(Chart chart, ChartProxy proxy)Associates the controller with a chart + proxy pair. Passing null detaches.
Parameters
| Name | Type | Description |
|---|---|---|
chart |
ChartGuru.Chart | |
proxy |
ChartGuru.ChartProxy | |
Tap(Vector2)
Section titled “Tap(Vector2)”public void Tap(Vector2 chartPos)Handle a click / tap at the given chart-space position. Toggles selection
at the mark containing the pointer when ChartGuru.ChartInteractionController.EnableSelection is true.
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
HoverMove(Vector2)
Section titled “HoverMove(Vector2)”public void HoverMove(Vector2 chartPos)Handle hover-move at the given chart-space position. Updates
ChartGuru.Chart.HoveredIndex and raises ChartGuru.ChartInteractionController.HoverChanged /
ChartGuru.ChartInteractionController.DataPointHovered when the hovered mark changes.
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
HoverExit()
Section titled “HoverExit()”public void HoverExit()Clears the hover state, e.g. when the pointer leaves the chart surface.
DragBegin(Vector2)
Section titled “DragBegin(Vector2)”public void DragBegin(Vector2 chartPos)Start a drag gesture. Records chartPos as the anchor for subsequent updates.
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
DragUpdate(Vector2)
Section titled “DragUpdate(Vector2)”public void DragUpdate(Vector2 chartPos)Update an in-flight drag. Routes to viewport scrolling (when
ChartGuru.ChartInteractionController.EnableViewportDrag is enabled and the chart is scrollable) or
drag-selection (when ChartGuru.ChartInteractionController.EnableDragSelection is enabled).
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
DragEnd(Vector2)
Section titled “DragEnd(Vector2)”public void DragEnd(Vector2 chartPos)End a drag gesture.
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
Wheel(Vector2, float)
Section titled “Wheel(Vector2, float)”public void Wheel(Vector2 chartPos, float scrollDelta)Handle a scroll-wheel / pinch gesture. Zooms around the cursor by a factor
derived from scrollDelta and ChartGuru.ChartInteractionController.ViewportZoomSensitivity.
Parameters
| Name | Type | Description |
|---|---|---|
chartPos |
UnityEngine.Vector2 | |
scrollDelta |
System.Single |