Hi, I am Implementing the Bar series, I am able to draw the Bars, But I need to apply differnt colors to each bar,
I have Searched and gone through the documentation, but unable to find it,
I am implementing by using Xaml and Viewmodel , code is like below
<telerikChart:RadCartesianChart x:Name="chart" Grid.Column="1" Grid.Row="0" HorizontalOptions="End" HeightRequest="80">
<telerikChart:RadCartesianChart.BindingContext>
<local:ChartsViewModel />
</telerikChart:RadCartesianChart.BindingContext>
<telerikChart:RadCartesianChart.HorizontalAxis>
<telerikChart:CategoricalAxis ShowLabels="False"/>
</telerikChart:RadCartesianChart.HorizontalAxis>
<telerikChart:RadCartesianChart.VerticalAxis>
<telerikChart:NumericalAxis ShowLabels="False" />
</telerikChart:RadCartesianChart.VerticalAxis>
<telerikChart:RadCartesianChart.Series>
<telerikChart:BarSeries CategoryBinding="Category"
ValueBinding="Value"
ItemsSource="{Binding Data}" ShowLabels="False">
</telerikChart:BarSeries>
</telerikChart:RadCartesianChart.Series>
</telerikChart:RadCartesianChart>
The code in View Model is
public ChartsViewModel()
{
this.Data = GetCategoricalData();
}
public ObservableCollection<CategoricalData> Data { get; set; }
private static ObservableCollection<CategoricalData> GetCategoricalData()
{
var data = new ObservableCollection<CategoricalData> {
new CategoricalData { Category = "A", Value = 10 },
new CategoricalData { Category = "B", Value = 8 },
new CategoricalData { Category = "C", Value = 15 },
new CategoricalData { Category = "D", Value = 9 },
new CategoricalData { Category = "E", Value = 6 },
new CategoricalData { Category = "F", Value = 5 },
new CategoricalData { Category = "G", Value = 2 },
};
return data;
}
public class CategoricalData
{
public object Category { get; set; }
public double Value { get; set; }
}
}
Now I would like to apply different colors to each Bar, and also need to reduce the width of the Bar.
Can any one Help me out how to achive this,