Webchart (chartjs) inside a desktop htmlviewer?

I quite like the webchart control item but it is only for web apps
would it be possible (how difficult would it be) to implement it inside a desktop htmlviewer ?

thanks for any hint(s).

I’ve successfully implemented Bokeh-based visualizations in a desktop app with the htmlviewer. Wasn’t too hard, and this was in the days before bidirectional interaction with Javascript was directly supported.

1 Like

I’ve implemented my own chart system using amCharts and htmlviewer.

I’ve created different static html files for each required chart configuration that have a data placeholder. Then, prior to rendering the chart I execute the needed SQL query to replace the placeholder with real data formatted as per chart configuration rules, and finally, the modified html file is loaded into htmlviewer.

Not so difficult.

1 Like

This is more or less the approach I took, as well. This is a pretty good pattern for working with the desktop htmlviewer, and in combination with interacting via javascript, it really adds a lot of possibilities for rich application user interfaces that take advantage of the range of web-based open-source projects available.

I’ve already done this with GraffitiChart for Desktop. Not overly difficult, great results.

1 Like

Why is there no ‘GraffitiChart for Web’?

There was for Web 1.0, but Xojo implemented ChartJS for Web 2.0, which is, in my opinion, the best library for charts. Since I can’t load and rely on my version of the library reliably, the risk of my product breaking if they were to update their version of the library was enough to kill that product in the 2.0 conversion.

You can look at the API of the Desktop version or the old Web 1.0 version to see what that would’ve looked like. It’s something I might revisit at some point, but there’s a lot of other things getting my attention at the moment.