在Angular-NVD3中更改折线图区域颜色

时间:2015-11-17 06:40:02

标签: javascript angularjs angular-nvd3

我正在使用Angular-NVD3库来显示一些折线图,我已经看到我可以在数据中将“area”属性设置为“true”,以便图形区域将被着色。

{
    values: [/** some data **/],
    key: 'Cosine Wave',
    color: '#2ca02c',
    area: true
}

live example

但是我找不到如何改变区域的颜色。默认情况下,图表将区域颜色设置为线条颜色的较浅色调,但我需要它为浅灰色。

API($ scope.options)是否允许这样的选项?有没有办法'破解'它?

1 个答案:

答案 0 :(得分:3)

我打开issue in github并得到了作者的回复,他建议更改区域的css规则并提供此代码段

.nvd3 .nv-group.nv-series-0 {
     fill: lightgray!important; /* color for area */
}

0是行索引)。

我在plunk测试了它,它可以根据需要运行!

相关问题