Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

echarts3中柱状图 柱子颜色怎么用渐变色? #4351

Closed
771752687 opened this issue Oct 28, 2016 · 3 comments
Closed

echarts3中柱状图 柱子颜色怎么用渐变色? #4351

771752687 opened this issue Oct 28, 2016 · 3 comments

Comments

@771752687
Copy link

问题简述 (One-line summary)

echarts3中柱状图 柱子颜色怎么用渐变色?

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version):
  • 浏览器类型和版本 (Browser version):
  • 操作系统类型和版本 (OS Version):

重现步骤 (Steps to reproduce)

期望结果 (Expected behaviour)

可能哪里有问题 (What went wrong)

ECharts配置项 (ECharts option)

option = {

}

其他信息 (Other comments)

@Carol1992
Copy link

Carol1992 commented Oct 28, 2016

// 线性渐变,前四个参数分别是 x0, y0, x2, y2, 范围从 0 - 1,相当于在图形包围盒中的百分比,如果最后一个参数传 true,则该四个值是绝对的像素位置

color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  offset: 0, color: 'red' // 0% 处的颜色
}, {
  offset: 1, color: 'blue' // 100% 处的颜色
}], false)
// 径向渐变,前三个参数分别是圆心 x, y 和半径,取值同线性渐变
color: new echarts.graphic.RadialGradient(0.5, 0.5, 0.5, [...], false)
// 纹理填充
color: new echarts.graphic.Pattern(
  imageDom, // 支持为 HTMLImageElement, HTMLCanvasElement,不支持路径字符串
  'repeat' // 是否平铺, 可以是 repeat-x, repeat-y, no-repeat
)

@pissang pissang closed this as completed Oct 31, 2016
@100pah
Copy link
Member

100pah commented Nov 3, 2016

@shady7shen
Copy link

echarts.graphic.Pattern 什么时候可以支持?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants