ProEssentials v10 WinForms .NET 8 — a dual-Y-axis Pego chart that combines
two complementary mouse-interaction techniques: a ConvPixelToGraph tooltip
showing both Y-axis values at the cursor, and a GetHotSpot status bar that
names the chart element under the cursor (data point, series legend, or point
label). Direct2D.
- Technique 1 —
ConvPixelToGraphtooltip (Example 007): thePeCustomTrackingDataTextevent converts the mouse pixel position to graph coordinates, called twice (left Y and right Y) to show both axis values at the cursor, interpolated continuously between data points. - Technique 2 —
GetHotSpotstatus bar (Example 014):MouseMovecallsGetHotSpot()to identify the named element under the cursor; when not over a named element,SearchSubsetPointIndexreports the nearest data point. - Dual Y axis via
RYAxisComparisonSubsets = 1— three regional sales series on the left Y, market-share percentage on the right Y. - Code-built UI — the form (status bar + chart) is constructed entirely in
C#; no
.Designer.cs, no.resx, so the WinForms designer is never invoked.
This is the WinForms sibling of the WPF Mouse Interaction example. The
ProEssentials chart configuration is identical between the two. The only
differences are the host shell (WinForms Panel status bar + docked chart vs
WPF Grid) and the geometry types in the mouse handlers: WPF's
System.Windows.Point / Rect become System.Drawing.Point / Rectangle on
the WinForms control (integer coordinates, no casts needed). GetHotSpot,
ConvPixelToGraph, and SearchSubsetPointIndex are chart-object members and
are unchanged.
➡️ WPF version: wpf-chart-mouse-interaction-hotspots-coordinate-tracking-proessentials
- Visual Studio 2022
- .NET 8 SDK (Windows)
- Internet connection for NuGet restore
- x64
- Clone this repository
- Open
MouseInteractionHotspots.slnin Visual Studio 2022 - Build → Rebuild Solution (restores the NuGet package automatically)
- Press F5
- Move the mouse over the chart — watch the tooltip show both Y values and the status bar name the element under the cursor. Left-drag to zoom; right-click for the context menu.
Designer note: This project has no
.Designer.csby design — the UI is built in code inMainForm.cs, avoiding native-control designer issues.
References ProEssentials.Chart.Net80.x64.Winforms
from nuget.org. Package restore happens automatically on build.
Example code is MIT licensed. ProEssentials requires a commercial license for continued use.
