Qt WebEngine: External canvas JS library
Unsolved
General and Desktop
-
I'm developing a Qt C++ GUI application and I would like to create a graph/plot using
Qt WebEngine
together with a external Javascript canvas library calledplotly.js
(website here)I tested this HTML + JS example source-code in my local browser. It works and display a simple 2D line chart.
<html> <head> <!-- Plotly.js --> <script src="https://cdn.plot.ly/plotly-latest.min.js"></script> </head> <!-- Plots go in blank <div> elements. You can size them in the plot layout, or give the div a size as shown here. --> <div id="tester" style="width:90%;height:250px;"></div> <script> TESTER = document.getElementById('tester'); Plotly.plot( TESTER, [{ x: [1, 2, 3, 4, 5], y: [1, 2, 4, 8, 16] }], { margin: { t: 0 } }, {showSendToCloud:true} ); </script> </html>
QUESTION:
Is possible to show this canvas inside my Qt application?
Obs.: I know that Qt have some built-in charts and I'm already using it. But now I really need to use the charts from
plotly.js
for another reasons.