在vue中使用highchart
首先安装highchart和vue-highchartsnpm install highchart --save--devnpm install vue-highcharts --save-dev让在main.js 中引入highchartimport Highcharts from 'highcharts';import VueHighcharts from 'vue-highcharts';.
·
首先安装highchart和vue-highcharts
npm install highchart --save--dev
npm install vue-highcharts --save-dev
让在main.js 中引入highchart
import Highcharts from 'highcharts';
import VueHighcharts from 'vue-highcharts';
Vue.use(VueHighcharts, { Highcharts });
在需要使用highchart的组件中调用highchart
import Highcharts from 'highcharts';
splineChart(id, data){ // id是highchart的HTML元素,data是传入到highchart需要显示的数据
Highcharts.chart(id, {
// 这里是highchart的配置信息
})
}
更多推荐
已为社区贡献5条内容
所有评论(0)