如何在vue项目实现图表---vue-schart(饼状图)

2024-10-19 17:35:04

1、安装vue-schart插件npm i vue-schart -S

如何在vue项目实现图表---vue-schart(饼状图)

3、启动项目npm run dev

如何在vue项目实现图表---vue-schart(饼状图)

5、模拟饼状图数据信息export default { data() { return { canvasId: 'myChart', type: 'pie', width: 600, height: 500, data: [ {name: '期刊', value: 1234}, {name: '图书', value: 2345}, {name: '小说', value: 2456}, {name: '文学', value: 333}, ], options: { title: 'example vue-schart', bgColor: '#829dca', titleColor: '#ffffff', legendColor: '#ffffff' } } }, components:{ Schart }}

如何在vue项目实现图表---vue-schart(饼状图)

7、查看效果

如何在vue项目实现图表---vue-schart(饼状图)
猜你喜欢