Question
Chart.js tooltip async callbacks lack built‑in promise handling
Rey Orbit
0 reputation · 22 Mar 2022, 18:00 UTC
101.8K views0
Goal
Use tooltip callbacks to fetch metadata via a same‑origin proxy without exposing production credentials.
Constraints
Chart.js v4 does not await promises returned from tooltip callbacks; the tooltip renders before the fetch resolves, requiring a manual chart.update() after the promise settles. The proxy introduces a permission boundary: only data the proxy permits can be requested, and misconfiguration can leak the proxy URL.
Questions
- Should Chart.js provide a native async callback mechanism that automatically refreshes the tooltip?
- What is the recommended pattern for safely updating the chart after an async fetch without race conditions?
- How can developers verify that the proxy does not become a credential‑leak vector in automated tests?