相关网站地址
官方示例
分享示例
ECharts 在线构建,定制化
主题编辑器 - Apache ECharts(自定义主题)
某些配置
改变画布内间距
grid: {top: 20,right: 20,bottom: 30,left: 50,},
hover 后的轴线背景
{tooltip: {trigger: 'axis',axisPointer: {type: 'shadow',}}}
轴线相关配置
axisTick: {// 刻度点线show: false,},axisLine: {// 轴线lineStyle: {color: '#FF0000',},},splitLine: {// 刻度盘中轴线lineStyle: {color: 'rgba(255, 255, 255, 0.15)',},},
折线图
{grid: {top: 10,right: 10,bottom: 40,left: 30,},xAxis: {type: 'category',boundaryGap: false, // 轴线留白data: ['2020.11', '2020.12', '2021.01', '2021.02', '2021.03', '2021.04'],axisLabel: { // 刻度文本color: 'rgba(255, 255, 255, 1)',rotate: 40, // 旋转},axisTick: {show: false, // 去掉刻度点线},},yAxis: {type: 'value',axisLabel: {color: 'rgba(255, 255, 255, 1)',},splitLine: {lineStyle: { // 轴线样式color: 'rgba(255, 255, 255, 0.15)',},},},series: [{data: [0, 23, 10, 13, 19, 25],type: 'line',symbol: 'none', // 折线类型,不带圆点itemStyle: {color: '#ffffff',},areaStyle: { // 面积图渐变效果color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{offset: 0,color: 'rgba(14, 219, 201, 1)', // 0% 处},{offset: 0.5,color: 'rgba(14, 219, 201, 0.8)', // 50% 处},{offset: 1,color: 'rgba(14, 219, 201, 0)', // 100% 处},]),},},],tooltip: { // 提示区域效果trigger: 'axis',axisPointer: {axis: 'x',lineStyle: {type: 'solid',},},backgroundColor: '#002157',borderWidth: 1,borderColor: '#798CB2',textStyle: {fontSize: 12,color: '#fff',},formatter: '{b} {c}次',},}
问题汇总
series not exists. Legend data should be same with series name or data name
配置字段和数据字段名称不一致,或者数量不一致导致的。
