如何更改 Angular 2+ 的 kendo 迷你图的条形颜色
How can I change the bar color of a kendo sparkline for Angular 2+
我有一个 kendo 迷你图,子弹图 angular 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
}]
};
我有一个 kendo 迷你图,子弹图 angular 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
}]
};