javascript - Angular Flot - 通过 Alpha 传递十六进制颜色在 Google Chrome 中不起作用

标签 javascript css angularjs google-chrome flot

我目前正在使用 angular-flot库并面临 Google Chrome 浏览器中的奇怪行为和 flot 的 bands 功能。

图片说了1000多字,先上问题截图:

工作示例(Firefox): enter image description here

问题(Chrome):

enter image description here

因此,谷歌浏览器似乎在解析具有 Alpha 值的 Hexcolor 时存在一些问题。下面的代码显示了带有 bands 特征的行的 JSON(表示这个特定情况下的标准偏差)。

$scope.ChartOptions.series.push({
                    "label": "Testgraph",
                    "color": '#33FF55",
                    rendererOptions: {
                        bands: {
                            show: true,
                            interval: statisticsService.standardDeviation($scope.Data[i]),
                            fillColor: "#8CFF3333"
                        }
                    }
                });

最佳答案

具有 alpha 值的十六进制颜色代码最近才成为 CSS 标准的一部分,并且仅受某些浏览器(例如 Firefox)支持,其他浏览器(例如 Chrome、IE)不支持,参见 here了解更多信息。

使用 rgba(140, 255, 51, 0.2) 通知让它在所有浏览器中工作。

关于javascript - Angular Flot - 通过 Alpha 传递十六进制颜色在 Google Chrome 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43518793/

相关文章:

javascript - 避免回调 hell 。 Meteor.call promise

javascript - 如何用JS根据表单输入重定向到特定页面?

javascript - 如何使用 $http 进行同步 http 请求循环?

html - css: 从底部开始填充 repeat-y

javascript - 评估点表示法中的字符串以从 View 中的对象获取相应的值

javascript - 将时间存储在表单中以发送到 Jquery

javascript - Bootstrap 4 下载的文件不起作用。我错过了什么吗?

jquery - Bootstrap 3 工具提示向右移动 - 这是一个错误吗?

javascript - angularjs 添加新的依赖

javascript - AngularJS 更新 ng-include 和 ng-repeat 中的 $scope