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

Resize RadCartesianChart's height - is there a minimum height?

1 Answer 277 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 07 Jun 2017, 04:28 PM

Hi

I have a RadCartesianChart (see XAML below) in a DataGridTemplateColumn but cannot find a way to reduce the amount of vertical space it is taking up.  It seems to have a minimum height?  Please advise.

<DataGridTemplateColumn Header="MyColumn"
IsReadOnly="True"
Width="300">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<telerik:RadCartesianChart Name="MyChart"
VerticalAlignment="Stretch"
Margin="10"
MaxHeight="20">
<telerik:RadCartesianChart.Behaviors>
<telerik:ChartTooltipBehavior />
</telerik:RadCartesianChart.Behaviors>
<telerik:LineSeries ItemsSource="{Binding HistoricValues}"
ValueBinding="RawValue"
CategoryBinding="Year">
<telerik:LineSeries.PointTemplate>
<DataTemplate>
<Ellipse Fill="Blue"
Width="8"
Height="8"/>
</DataTemplate>
</telerik:LineSeries.PointTemplate>
</telerik:LineSeries>
<telerik:RadCartesianChart.HorizontalAxis>
<telerik:CategoricalAxis />
</telerik:RadCartesianChart.HorizontalAxis>
<telerik:RadCartesianChart.VerticalAxis>
<telerik:LinearAxis Minimum="{Binding HistoricValueMinimum}"
Maximum="{Binding HistoricValueMaximum}"
MajorStep="{Binding HistoricValueStep}"
Visibility="Collapsed"/>
</telerik:RadCartesianChart.VerticalAxis>
</telerik:RadCartesianChart>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>

Thanks

 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 08 Jun 2017, 11:07 AM
Hello Jon,

RadCartesianChart has MinHeight set to 100. You can set it to 0.
<telerik:RadCartesianChart MinHeight="0"/>

Regards,
Martin Ivanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Chart
Asked by
Jon
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or