Add chartJS to Quasar



  • npm install vue-chartjs

    1.Chart component (.js not .vue)

    0_1476777013409_img2361.jpg

    2.Parent component

    0_1476777003244_img2362.jpg

    3.Result

    0_1476777019880_img2360.jpg


  • Admin

    Nice work! Thanks for sharing this!



  • this slightly changed with the new VueJS Version :

    commitChart.js :

    import {
      Bar
    }
    from 'vue-chartjs'
    
    export default {
      extends: Bar,
      props: ['data'],
      mounted: function () {
        this.renderChart(this.data, this.options)
      },
      data () {
        return {
          options: {
            title: {
              display: true,
              text: 'some title'
            }
          }
        }
      }
    }
    

    THe rest remains the same.


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.