Hi All,
I am trying to create a horizontal stacked bar to show data. Below is the code I have so far.
The problems that I'm having are:
1. It creates the chart but the data bar seems to be vertical. I want it to go horizontal.
2. I want each segment of the bar to have a different color automatically from the theme.
3. I want each segment of the bar to have its own tooltip.
What am I missing?
Thanks for your help!
this.Chart = new Telerik.Windows.Controls.RadCartesianChart() {
MinHeight = 0,
MinWidth = 0,
HorizontalAxis = new Telerik.Windows.Controls.ChartView.CategoricalAxis() {
Visibility = System.Windows.Visibility.Collapsed,
},
VerticalAxis = new Telerik.Windows.Controls.ChartView.LinearAxis() {
Visibility = System.Windows.Visibility.Collapsed,
}
};
Chart.Background = System.Windows.Media.Brushes.Green;
Chart.HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch;
Chart.VerticalAlignment = System.Windows.VerticalAlignment.Stretch;
var DataSeries = new Telerik.Windows.Controls.ChartView.BarSeries();
DataSeries.CombineMode = Telerik.Charting.ChartSeriesCombineMode.Stack100;
foreach (var item in e.Parameters) {
DataSeries.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Value = item.Used, Category = "1" });
DataSeries.DataPoints.Add(new Telerik.Charting.CategoricalDataPoint() { Value = item.Available, Category = "1" });
}
Chart.Series.Add(DataSeries);