Forum Replies Created by danb4r

Viewing 2 posts - 1 through 2 (of 2 total)
  • in reply to: CanvasJS with vuejs using webpack #29761

    @manoj-mohan, unfortunately my project is huge and has private code from my client, so I will not be able to share it this time. What I can tell is that for CanvasJS work with Quasar.dev, I putted CanvasJS in a separate component and did the following:

    Added canvasjs.min.js to /src/assets/canvasjs.min.js:

    var CanvasJS = require('src/assets/canvasjs.min.js')
    
    

    CanvasJS = CanvasJS.Chart ? CanvasJS : window.CanvasJS

    Quasar automagically replaces ‘src/..’ with the correct path for webpack.

    Also, I had to correct the canvasjs.min.js lint comments, as the linter requires spaces after /* and befor */. I suggest you guys test the lib on Quasar, as it is a more and more adopted framework.

    Also, as a performance measure, I declared all Canvas variables outside of the “export default { }”, as they do not need to be reactive in my project, as my data source is an Axios service.

    Apart from these measures, I followed your example above for Vue.js.

    in reply to: CanvasJS with vuejs using webpack #29638

    I managed to make canvasJS to work on Quasar (Vue+Webpack) using this sample project from @manoj-mohan. CanvasJS only worked inside a component, not inside the MainLayout.vue.

    • This reply was modified 4 years, 5 months ago by danb4r.
Viewing 2 posts - 1 through 2 (of 2 total)