Search code examples
nativescriptnativescript-angularnativescript-telerik-uinativescript-vuenativescript-plugin

Nativescript-vue, How to change BarSeries(Radchart) graph "bars" color?


Code:

<BarSeries v-tkCartesianSeries
             categoryProperty="Country"
             valueProperty="Amount"
             :items="items1" />
<CategoricalAxis v-tkCartesianVerticalAxis />
<LinearAxis v-tkCartesianHorizontalAxis />

Solution

  • You have to define Palette with same series name

                <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 />