Vue-chartjs load data

Linechart.js

import { Line } from "vue-chartjs"

export default {
  extends: Line,
    mounted () {
      this.renderChart({
        labels: ["1","2","3","4","5","6","7"],
        datasets: [
          {
            label: "Data One",
            backgroundColor: "-sharpF64A32",
            data: [40,30,50,20,60,30,20]
          }
        ]
      }, {responsive: true, maintainAspectRatio: false})
    }
}

example.vue

<template>
<line-chart :width="370" :height="246"></line-chart>
</template>
<script>
import LineChart from "./vue-chartjs/LineChart"
export default {
components: {
      LineChart
    },
},
    methods:{
      getdata(){
        var user_id = this.getcookies("user_id");
          this.$http.post("http://example.com",{
            //post body
            user_id:user_id
          },{headers:{
            "datatoken":data_token,            
          }}).then((data)=>{
            //success
            //data dataLinechart.jsdata
          })
        }
    }

</script>

suppose the return value of post is an array of data,. What should I do now if I want to assign a value to the data variable in Linechart.js?

Feb.27,2021

write props in Linechart.js

    props: {
        Data: {
          type: Array,
          default: []
        },
    }

pass data in example.vue

<line-chart 
    :width="370" 
    :height="246"
    :Data="data">
</line-chart>

so Linechart.js can get the array

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1eb0cab-5d11f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1eb0cab-5d11f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?