/* * @Author: your name * @Date: 2021-07-01 00:39:07 * @LastEditTime: 2021-07-01 00:39:56 * @LastEditors: Please set LastEditors * @Description: In User Settings Edit * @FilePath: \evm-store\frontend\src\utils\myCharts.js */ import * as echarts from "echarts"; const install = function (Vue) { Object.defineProperties(Vue.prototype, { $chart: { get() { return { line: function (id) { this.chart = echarts.init(document.getElementById(id)); this.chart.clear(); const optionData = { xAxis: { type: "category", data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], }, yAxis: { type: "value", }, series: [ { data: [820, 932, 901, 934, 1290, 1330, 1320], type: "line", smooth: true, }, ], }; this.chart.setOption(optionData); }, }; }, }, }); }; export default { install, };