Starting the ChartForgeX engine
The browser downloads the engine on first use and caches it for later visits. Every edit is prepared in your browser; nothing is sent anywhere.
Connect the editor to a native host
The chart runtime owns the editor: anchors, the caption field, apply, undo and redo. It never moves a drawing itself. Each applied edit becomes a request that the host answers with a freshly prepared chart, so what you see is always what .NET rendered. Here the host is ChartForgeX running in this page as WebAssembly; in an application it is your server or desktop process.
const chart = ChartForgeXCharts.mount(section);
chart.connectNative(async (request, signal) => {
// request: { kind, annotationId, sourceDrawing, basis }
const reply = await host.prepareAnnotation(request);
return { html: reply.html, basis: reply.basis };
}, { basis: initialBasis, axes: null });
chart.editAnnotations({ createId: kind => nextId(kind) });Try it
Choose Add note, Add line or Add channel, drag an anchor or move it with Shift and the arrow keys, type a caption, then Apply. Edit and Delete work on the drawing picked in the list.
A saved page has no host, so it shows the drawings without the editor.