Size of chart in view

2 posts, 0 answers
  1. Torrie Graeff
    Torrie Graeff avatar
    1 posts
    Member since:
    Feb 2010

    Posted 03 Feb 2010 Link to this post

    I have a chart in a user control and I want to have my page contain that user control view at a particular size.  Unfortunately, when I set the height & width of the view, it just affects the view size and doesn't resize the chart to that size.  How can I make my chart resize to the size of what the parent page is telling it to be?

    On my main page, I have this:
    <Views:SeasonRevenueBreakdown Height="200" Width="300" Grid.Column="0" Grid.Row="1" /> 

    And in my user control markup I have this:
        <StackPanel Background="Black" Orientation="Vertical"
            <telerikChart:RadChart x:Name="RevenuePie" Height="450" Width="640" > 
                            <chart:ChartArea LegendName="CustomLegend"
                                            <chart:PieSeriesDefinition /> 
                                        <chart:DataPoint LegendLabel="1" LabelFormat="#%" YValue="70" /> 
                                        <chart:DataPoint LegendLabel="2" LabelFormat="#%" YValue="16" /> 
                                        <chart:DataPoint LegendLabel="3" LabelFormat="#%" YValue="4" /> 
                                        <chart:DataPoint LegendLabel="4" LabelFormat="#%" YValue="7" /> 
                                        <chart:DataPoint LegendLabel="5" LabelFormat="#%" YValue="3" /> 
                            <chart:ChartLegend x:Name="CustomLegend" /> 
                            <chart:ChartTitle Content="Season Revenue Breakdown" /> 
            <Button Height="27" Content="Save Chart" Click="Button_Click" /> 

  2. Ves
    Ves avatar
    2926 posts

    Posted 05 Feb 2010 Link to this post

    Hello Torrie,

    You can wrap RadChart in a grid and remove chart's Width and Height settings:

            <RowDefinition Height="*"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        <telerikChart:RadChart x:Name="RevenuePie">
        <Button Height="27" Content="Save Chart" Click="Button_Click" Grid.Row="1" />

    Best regards,
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
Back to Top