Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt WebEngine: External canvas JS library
Forum Updated to NodeBB v4.3 + New Features

Qt WebEngine: External canvas JS library

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 386 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fem_dev
    wrote on 31 Oct 2019, 19:37 last edited by
    #1

    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 called plotly.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?
    c3f4b54a-a6a9-47d4-8ce7-be9aa9061dfe-image.png

    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.

    1 Reply Last reply
    0

    1/1

    31 Oct 2019, 19:37

    • Login

    • Login or register to search.
    1 out of 1
    • First post
      1/1
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved