Home Forums Chart Support Multiple Charts not working

Multiple Charts not working

Viewing 2 posts - 1 through 2 (of 2 total)
  • #61144

    I have written a VB.Net application which loads/manipulates data into a database. It then runs multiple queries depending on the data which are written as separate subroutines and outputs the results as an HTML report.

    I have started to build canvasJS into each function & am struggling with a problem. I have a subroutine which loads canvas.min.js at the beginning of the HTML and I created the first chart in the first subroutine which worked as expected.

    I then created a 2nd chart looking at the example at https://canvasjs.com/docs/charts/how-to/render-multiple-charts-in-a-page/ . The output is not showing the first chart just a blank, and the 2nd chart is shown correctly.

    I am sure its something silly.. the code looks like this..

    https://drive.google.com/file/d/1FX2jGrh-Lk9q4tXWbWIJktWiuaExPNu3/view?usp=sharing

    #61146

    @g4naq,

    It seems your VB.Net code is creating two <script> blocks with separate window.onload functions, causing the second chart (“ITU Zones”) to overwrite the first (“QSOs by Hour”), resulting in a blank first chart. To fix this, either combine the instantiation and render of both the charts within a single window.onload function in one <script> block, or place a single <script> block without window.onload at the end of the <body> tag to execute after the DOM loads. Both approaches ensure both charts render correctly in your Windows Forms app’s WebBrowser control.

    If the issue persists, kindly create sample project (sample / dummy data) reproducing the issue you are facing & share it with us via Google Drive or OneDrive so that we can run it at our end to understand the scenario better & help you out.


    Vishwas R
    Team CanvasJS

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.