This project demonstrates how to integrate CanvasJS interactive charts into a Delphi VCL application using the built-in TWebBrowser.
- Local HTML chart rendered in
TWebBrowser - CanvasJS
columnchart - Chart data passed dynamically from Delphi variables
- Reload chart with new data using a button click
Unit1.pas/Unit1.dfm— Delphi form and codecanvasjs.min.js— Local copy of the CanvasJS libraryCanvasJS_Chart.dpr— Project fileREADME.md— This file
- Open
CanvasJS_Chart.dprojin Delphi - Make sure
canvasjs.min.jsis in the same folder as the EXE - Run the project
- Click the button to reload the chart with new data
- Tested with Delphi 10+
- Works with TWebBrowser (Internet Explorer engine)
- The WebBrowser control uses IE7 mode by default. To enable full HTML5 & JavaScript support, the app sets the IE emulation mode to IE11 using the Windows registry.
- You can switch to TWebView2 (Edge) for better modern HTML/JS support.
This project uses CanvasJS under its free non-commercial license. For commercial usage, please get a license.
Made with ❤️ using Delphi and CanvasJS.
