博客
关于我
Echarts柱状图采用不同色
阅读量:203 次
发布时间:2019-02-28

本文共 777 字,大约阅读时间需要 2 分钟。

效果图

echarts配置

option = {    xAxis: {        type: 'category',        data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']    },    yAxis: {        type: 'value'    },    series: [{        data: [120, 200, 150, 80, 70, 110, 130],        type: 'bar',        showBackground: true,        itemStyle: {            normal: {              color: function (params) {                var colorList = [                  '#C1232B', '#B5C334', '#FCCE10', '#E87C25', '#27727B',                  '#FE8463', '#9BCA63', '#FAD860',                ];                return colorList[params.dataIndex]              },            },        },        backgroundStyle: {            color: 'rgba(220, 220, 220, 0.8)'        }    }]};

转载地址:http://orii.baihongyu.com/

你可能感兴趣的文章
Python 中如何使用 lambda 函数
查看>>
Python 中如何创建多行字符串?
查看>>
Python 中如何处理异常?
查看>>
Python 中如何实现列表的切片?
查看>>
Python 中如何实现字典的排序?
查看>>
Python 中常用的数据类型及相关操作详解
查看>>
Python 中的注意点_s2
查看>>
Python 中的生成器是什么?
查看>>
Python 中的离线语音转文本
查看>>
Python读写json文件的简单实现
查看>>
Python 中的线程
查看>>
Python 中的继承机制是什么样的?
查看>>
python读写excel之xlrd&xlwt&xlutils组合
查看>>
Python 中的装饰器是什么?
查看>>
Python 中的装饰器是如何工作的,有哪些实际应用场景?
查看>>
python读excel
查看>>
Python 中读取 CSV 文件-ChatGPT4o作答
查看>>
Python 之 filecmp
查看>>
python请求html_使用Python请求获取HTML?
查看>>
Python 之匿名函数和偏函数
查看>>