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

Uncaught SyntaxError: Failed to execute 'addColorStop' on 'CanvasGradient' #7761

Closed
RicoLiu opened this issue Feb 9, 2018 · 1 comment
Closed

Comments

@RicoLiu
Copy link

RicoLiu commented Feb 9, 2018

One-line summary [问题简述]

Android 原生 webview 加载 html 页面时报错:

The value provided('#FFFFFFFF') could not be parsed as a color.

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]: 3.8.5
  • Browser version [浏览器类型和版本]: *
  • OS Version [操作系统类型和版本]: Android

Expected behaviour [期望结果]

能够兼容颜色值: ‘#FFFFFFFF’

ECharts option [ECharts配置项]

option = {
      ...
                         {
                            type: 'bar',
                            itemStyle: {
                                normal: {
                                    color: new echarts.graphic.LinearGradient(
                                        0, 0, 0, 1, [{
                                                offset: 0,
                                                color: '#FFFFFFFF'
                                            },

                                            {
                                                offset: 1,
                                                color: '#FFFFFF00'
                                            }
                                        ]
                                    ),
                                    barBorderRadius: [4, 4, 0, 0]

                                }
                            },
   ...
}

Other comments [其他信息]

@RicoLiu
Copy link
Author

RicoLiu commented May 11, 2018

'#FFFFFFFF' ---> 'rgba(255, 255, 255, 1)'
'#FFFFFF00' ---> 'rgba(255, 255, 255, 0)'

fix it

@RicoLiu RicoLiu closed this as completed May 11, 2018
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

1 participant