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

给坐标轴的axisLine.lineStyle.color设置渐变颜色报错 #3577

Closed
Greenmzc opened this Issue Jul 7, 2016 · 1 comment

Comments

Projects
None yet
3 participants
@Greenmzc

Greenmzc commented Jul 7, 2016

问题简述 (One-line summary)

给坐标轴的axisLine.lineStyle.color设置渐变颜色,官方例子如下

color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
  offset: 0, color: 'red' // 0% 处的颜色
}, {
  offset: 1, color: 'blue' // 100% 处的颜色
}], false)

当最后一行true是可以的,false就会报错,无论x轴还是y轴都是如此

版本及环境 (Version & Environment)

  • ECharts 版本 (ECharts version): 3.2.1
  • 浏览器类型和版本 (Browser version): chrome 51
  • 操作系统类型和版本 (OS Version): OS X 10.11 5

重现步骤 (Steps to reproduce)

期望结果 (Expected behaviour)

出现渐变颜色

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

绘制canvas时起始坐标和终止坐标类型错误,解析为NaN

ECharts配置项 (ECharts option)

option = {
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: date,
    axisLine: {
      lineStyle: {
        color: new echarts.graphic.LinearGradient(0, 0, 1, 1, [
          {
            offset: 0,
            color: '#000'
          }, {
            offset: 1,
            color: '#f00'
          },
        ], false)
      }
    }
  },
}

其他信息 (Other comments)

报错信息
2016-07-07 5 42 36
2016-07-07 5 51 51

@pissang pissang added the pending label Jul 7, 2016

@pissang pissang closed this in 0ca7b34 Jul 8, 2016

@zhaozhuoboy

This comment has been minimized.

Show comment
Hide comment
@zhaozhuoboy

zhaozhuoboy Sep 17, 2018

How is this problem solved?

zhaozhuoboy commented Sep 17, 2018

How is this problem solved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment