如何更改Angular 2+的剑道迷彩线的条形颜色

问题描述 投票:0回答:1

我有一个剑道迷彩线,角度为2的子弹图。栏的默认颜色是橙色,但我需要改变颜色。我查看了进度网站上的参考资料,看起来值轴有一个color property,但是当我尝试更改它时,条形图消失了。

HTML

    <kendo-sparkline [data]="Data" type="bullet" [valueAxis]="bulletValueAxis">
    </kendo-sparkline>

.ts文件 - 值轴

        this.bulletValueAxis = {
        min: 0,
        max: 30,
        color: 'purple',
        background: 'grey',
        // title: { text: 'test' },
        type: 'numeric',
        plotBands: [{
            from: 0, to: this.config.min, color: 'yellow', opacity: 0.3
        }, {
            from: this.config.min, to: this.config.max, color: '#008b00', opacity: 0.3
        }, {
            from: this.config.max, to: this.config.max + 5, color: '#ff0000', opacity: 0.3
        }]
    };
angular kendo-ui kendo-ui-angular2
1个回答
2
投票

color属性是series或seriesDefaults配置的一部分(而不是valueAxis),例如:

<kendo-sparkline [data]="bulletData" type="bullet" [seriesDefaults]="{color: 'purple'}" [valueAxis]="bulletValueAxis">

EXAMPLE

© www.soinside.com 2019 - 2024. All rights reserved.