博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
echarts的渐变色配置 LinearGradient
阅读量:4167 次
发布时间:2019-05-26

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

// 0, 0, 0, 1 代表右/下/左/上// offset 范围0-1 表示什么时候开始使用对应颜色color: new echarts.graphic.LinearGradient( 0, 0, 0, 1, [                    {
offset: 0, color: 'red'}, // 开始位置 // {offset: 0.5, color: 'green'}, {
offset: 1, color: 'skyblue'} // 结束位置 ] )

示例 :

1,0,0,0 从右开始 (红色开始色)
在这里插入图片描述

1,1,0,0 右上(红色开始色)

在这里插入图片描述

1,0,1,0 右左不存在, 所以不显示

1,0,0,1 右下(红色开始色)

在这里插入图片描述

1,1,1,0 右上左(红色开始色) 效果等同 0,1,0,0

在这里插入图片描述

1,0,1,1 右左下(红色开始色) 效果等同 0,0,0,1

在这里插入图片描述

1,1,0,1 右上下(红色开始色) 效果等同 1,0,0,0

在这里插入图片描述

测试用代码

option = {
xAxis: {
type: 'category', data: ['渐变色'] }, yAxis: {
}, series: [{
data: [120], type: 'bar', itemStyle:{
color:new echarts.graphic.LinearGradient( 1, 0, 0, 0, [ {
offset: 0, color: 'red'}, // {offset: 0.5, color: 'green'}, {
offset: 1, color: 'skyblue'} ] ) } }]};

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

你可能感兴趣的文章
python字典复制(浅拷贝and深拷贝)
查看>>
python set集合的特点,功能and常见方法
查看>>
python set集合运算(交集,并集,差集,对称差集)
查看>>
python字符串replace()方法
查看>>
python替换文件中的指定内容
查看>>
linux系统下python tab键补全(2步搞定)
查看>>
linux locate 命令使用示例
查看>>
eclipse PyDev 字符集编码设置的3种方法
查看>>
eclipse字体大小设置
查看>>
python __init__.py __name__ __doc__ __file__ argv[0] 浅析
查看>>
Python 命名空间和LEGB规则
查看>>
python 函数的嵌套定义 and 函数的返回值是函数
查看>>
Python 内置函数 locals() 和globals()
查看>>
Python repr() 函数和str() 函数
查看>>
cmd命令里的路径包含空格 的解决方法
查看>>
linux命令执行后的 返回值与错误代码
查看>>
python os.system(command)函数的返回值 与 linux命令返回值的关系
查看>>
python os.system()和os.popen()
查看>>
python sys.argv[]用法
查看>>
eclipse python代码块 整体缩进 以及 整体取消缩进
查看>>