Nativescript-vue,如何更改 BarSeries(Radchart) 图 "bars" 颜色?
Nativescript-vue, How to change BarSeries(Radchart) graph "bars" color?
代码:
<BarSeries v-tkCartesianSeries
categoryProperty="Country"
valueProperty="Amount"
:items="items1" />
<CategoricalAxis v-tkCartesianVerticalAxis />
<LinearAxis v-tkCartesianHorizontalAxis />
您必须使用相同的系列名称
定义 Palette
<BarSeries v-tkCartesianSeries :items="items1"
categoryProperty="Country" valueProperty="Amount"
seriesName="myLine" />
<Palette v-tkCartesianPalette seriesName="myLine">
<PaletteEntry v-tkCartesianPaletteEntry strokeWidth="5"
strokeColor="red" fillColor="red"></PaletteEntry>
</Palette>
<CategoricalAxis v-tkCartesianHorizontalAxis />
<LinearAxis v-tkCartesianVerticalAxis />
只需在 BarSeries
中使用 fillColor
和 strokeColor
<RadCartesianChart>
<CategoricalAxis v-tkCartesianHorizontalAxis />
<LinearAxis v-tkCartesianVerticalAxis />
<BarSeries v-tkCartesianSeries :items="items" categoryProperty="" valueProperty="" fillColor="red" />
</RadCartesianChart>
代码:
<BarSeries v-tkCartesianSeries
categoryProperty="Country"
valueProperty="Amount"
:items="items1" />
<CategoricalAxis v-tkCartesianVerticalAxis />
<LinearAxis v-tkCartesianHorizontalAxis />
您必须使用相同的系列名称
定义Palette
<BarSeries v-tkCartesianSeries :items="items1"
categoryProperty="Country" valueProperty="Amount"
seriesName="myLine" />
<Palette v-tkCartesianPalette seriesName="myLine">
<PaletteEntry v-tkCartesianPaletteEntry strokeWidth="5"
strokeColor="red" fillColor="red"></PaletteEntry>
</Palette>
<CategoricalAxis v-tkCartesianHorizontalAxis />
<LinearAxis v-tkCartesianVerticalAxis />
只需在 BarSeries
中使用fillColor
和 strokeColor
<RadCartesianChart>
<CategoricalAxis v-tkCartesianHorizontalAxis />
<LinearAxis v-tkCartesianVerticalAxis />
<BarSeries v-tkCartesianSeries :items="items" categoryProperty="" valueProperty="" fillColor="red" />
</RadCartesianChart>