echarts图表option配置项

  1. x轴字体倾斜
option = {
  xAxis: [{
    axisLabel: {
      interval: 0,//防止文字过多时隐藏
      rotate: 40//字体倾斜度数
    }
  }]
}
  1. 图形上显示数值
option = {
    series: [{
        label: {
            show: true,//图形上显示数值
            position: ''//数值显示方向 top|right|bottom|left|''
        },
        data: [1, 2, 3, 4, 5, 6],
        type: 'line'
    }]
}
  1. 颜色配置
option = {
    legend: {//说明标签
        type: 'scroll',
        data: ['name1'],
        textStyle: {
            color: 'pink'
        }
    },
    xAxis: [{//x轴
        axisLabel: {//文字
            formatter: '{value}',
            textStyle: {
                color: 'pink'
            }
        },
        axisLine: {//线条
            lineStyle: {
                color: 'pink'
            },
        },
        axisTick: {//刻度
            lineStyle: {
                color: 'pink'
            }
        }
    }],
    yAxis: [],//与x轴设置方法一致
    series: [{
        name: 'name1',
        type: 'bar',
        data: [1,2,3],
        label: {//图形上的文字
            show: true,
            position: 'top',
            textStyle:{
                color: 'pink'
            }
        }
    }]
}
  1. 折线图线条断开效果
series: [{
    data: [82, 93, null, 93, 128, 133, 132],//插入空值即可[null]
    type: 'line'
}]
  1. 滑过图形时,tooltip提示框超出容器问题
    tooltip = {
    trigger: 'item',
    formatter: '{b}: {c}%',
    confine: true //禁止超出容器
    }
>死亡不是终点, 被遗忘才是.

已更新4/100个配置

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容