1,有关echarts引用的相关报错直接写这句 import * as echarts from 'echarts'
2,折线图
chartsObj = {
tooltip: {
trigger: 'axis',
axisPointer: {
type:'none', // 默认为line,不关闭会有引线跟随
},
formatter(params:any) { //自定义提示框,可打印params查看
let str = ''
params.forEach((item:any)=>{
str += `${item.name}
3,饼图
chartsObj ={
title: {
textStyle: {
fontFamily: 'PingFangSC-Medium, sans-serif',
fontWeight: 500,
fontSize: 14
},
bottom: '15%',
left: '40%'
},
legend: {
right:10,
top:10,
orient : 'vertical',
icon: "circle",
type: "scroll", // 是否开启切换图例分页
itemWidth: 12, // 图例标记的图形宽度。
itemHeight: 12, // 图例标记的图形高度。
width: 'auto', // 图例组件的宽度
height: 'auto', // 图例组件的高度
},
tooltip: {
// trigger: 'item',
formatter(item:any) {
let str = ''
str += `${item.name}
手机扫一扫
移动阅读更方便
你可能感兴趣的文章