4 · Chart Snap Point
Line chart built with BlazorExpress.ChartJS (the chart package that replaces the
Blazor.Bootstrap charts from v4 onwards). Clicking a point makes the event
snap to the closest data point and opens its link in a new tab.
Click and snap settings
Tickets per day · click a point
Chart waiting to be initialized.
Selected point
No point has been selected yet.
INFO
Case 4 findings
- In
Blazor.Bootstrap 4.0.0the charts moved to theBlazorExpress.ChartJSpackage; v3.5.0 still bundles them but without click events. BlazorExpress.ChartJS 1.2.4exposesOnClickwithDatasetIndex,DatasetLabel,Index,LabelandValue, which is enough to resolve the point's link.- The "snap" is resolved by Chart.js with
getElementsAtEventForMode(event, 'nearest', { intersect }): withintersect: truethe click must hit the point; withintersect: falsegetting close is enough. - Opening the tab from the JS handler (Mode B) is more reliable: it happens inside the user gesture, so the browser does not treat it as a pop-up.