Home Forums Chart Support OffScreenCanvas

OffScreenCanvas

Viewing 4 posts - 1 through 4 (of 4 total)
  • #32651

    Hi there, Im having a big problem with performance. Im connected with websocket which sends data each second (actually 3 or 4 new data each second), and i use chart.render() every time i get a new value.
    The problem comes when wesocket send a huge amount of data or if i let the tab in background ( that means that chart.render() is called multiple times while is in background ) and when i return to tab, the app needs to wait to all that render() calls and the website freezes.

    I was looking for some solution, and i get workers and OffScreenCanvas, but i found nothing about that in your docs, is there any option to render in background or offscreen??

    Im using Vuejs and canvajs.min.js

    • This topic was modified 3 years, 2 months ago by Nerviozzo96.
    #32675

    @nerviozzo96,

    The dynamic chart seems to be working fine at our end even for longer durations.

    Can you kindly create a sample project reproducing the issue you are facing and share it with us over Google-Drive or Onedrive along with the sample data so that we can run the code locally at our end, look into the chart-options being used by you and help you out?


    Shashi Ranjan
    Team CanvasJS

    #33043

    Thanks for the answer. I finally get good optimization in my end, making less render() calls. Ty any ways

    • This reply was modified 3 years, 1 month ago by Nerviozzo96.
    #33119

    @nerviozzo96,

    Glad that you figured it out :)

    You can also follow the below guidelines for more optimization:
    1. If your page has dynamic charts, update chart options and re-render and don’t instantiate / create new chart on every update.
    2. If you are populating data from JSON or CSV using AJAX, instantiate chart once and update data within AJAX request and do not instantiate / create new chart within every AJAX request.


    Shashi Ranjan
    Team CanvasJS

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

You must be logged in to reply to this topic.