记录echarts使用,记忆力不行,总忘事。
- 安装
npm install echarts --save
- 引用
import echarts from "echarts"
- 使用
dom:
注意:可以用ref,一定一定要有宽高
<div id="domHook" style="width: 900px; height: 400px;">
option:
const option = {
title: [ //标题
{
top: '3px',
left: 'center',
textStyle: {
fontSize: 16,
color:'#000033'
}
}
],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
animation: false,
label: {
backgroundColor: '#505765'
}
}
},
legend: {
top: 30,