Echarts运用笔记

  • 柱状图顶部数据展现

"itemStyle": {
 normal: {
     label: {
         show: true
     }
  }
}
  • 柱状图自定义主题

// 柱形图默许参数
    bar: {
        barMinHeight: 0,          // 最小高度改成0
        // barWidth: null,        // 默许自适应
        barGap: '30%',            // 柱间间隔,默许为柱形宽度的30%,可设固定值
        barCategoryGap : '20%',   // 类目间柱形间隔,默许为类目间距的20%,可设固定值
        itemStyle: {
            normal: {
                // color: '各别',
                barBorderColor: '#fff',       // 柱条边线
                barBorderRadius: 0,           // 柱条边线圆角,单元px,默许为0
                barBorderWidth: 1,            // 柱条边线线宽,单元px,默许为1
                label: {
                    show: false
                    // position: 默许自适应,程度规划为'top',垂直规划为'right',可选为
                    //           'inside'|'left'|'right'|'top'|'bottom'
                    // textStyle: null      // 默许运用全局文本款式,详见TEXTSTYLE
                }
            },
            emphasis: {
                // color: '各别',
                barBorderColor: 'rgba(0,0,0,0)',   // 柱条边线
                barBorderRadius: 0,                // 柱条边线圆角,单元px,默许为0
                barBorderWidth: 1,                 // 柱条边线线宽,单元px,默许为1
                label: {
                    show: false
                    // position: 默许自适应,程度规划为'top',垂直规划为'right',可选为
                    //           'inside'|'left'|'right'|'top'|'bottom'
                    // textStyle: null      // 默许运用全局文本款式,详见TEXTSTYLE
                }
            }
        }
    }
    原文作者:云贤力
    原文地址: https://segmentfault.com/a/1190000004301998
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞