This is a migrated thread and some comments may be shown as answers.

Trying to set height on RadCartesianChart Bars

1 Answer 80 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
mike asked on 17 Mar 2016, 08:05 PM


We are unable to vary the height of the bar series even though the below property is given properly. The bar series height and width gets adjusted by itself.
The objective is the height of the Chart should remain same as well as the bar inside of it. When only one bar for example, the width of the bar should not auto adjust to be fat. 

  <telerik:RadCartesianChart Palette="Windows8"

                        <telerik:LinearAxis Title="Days" />
                        <telerik:CategoricalAxis />
                        <telerik:BarSeries PaletteMode="DataPoint"
                                           ItemsSource="{Binding LstRunningBatch}"




1 Answer, 1 is accepted

Sort by
Telerik team
answered on 22 Mar 2016, 03:06 PM
Hello Mike,

Thank you for the provided information.

You can set the MaxHeight property of the bars by creating a custom DataTemplate and set it to the PointTemplate property of the BarSeries.
<Rectangle MaxHeight="30"
                Fill="{Binding Converter={StaticResource DataPointToBrushConverter}}"/>
Keep in mind that when you are using PointTemplate to customize the bar series, the Palette colors will not apply to the bars. In this case you can use an IValueConverter to get the fill color from the Palette and set it to the elements in the template. Note that, the DataContext passed to the PointTemplate is an object of type DataPoint which you can bind with the converter.  For your convenience, we have created a sample project where you can see how to implement this approach.

Please, give this project a try and let us know if this works for you.

Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question