Columnseries question & theme question

silverlight , charts , stretch Antwerp, Belgium
  • 11 years ago

    Hi, I have some layout questions, my databindings worked excellent, so great job guys!

    The thing is, I am using a couple of charts, and I want them to stretch themself according to the page, this works horizontally, but not vertically.

    I use the following xaml code:

    ]]> ]]>

    What am I doing wrong?

    By the way, I have one other question. Does some1 have the code of the backgroundgradient of the shiny blue theme? I need to make the same background colour. Or is there a way to override the colors shiny blue theme gives to Charts? (Cuz they're ugly as hell :P)

    Thanks gosu's

  • 11 years ago
    <Grid.RowDefinitions>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".5*" />
                <ColumnDefinition Width=".5*" />
            </Grid.ColumnDefinitions>
            <StackPanel Grid.Row="0" Grid.Column="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
                <chartingToolkit:Chart x:Name="columnChart1">
                    <chartingToolkit:Chart.LegendStyle>
                        <Style TargetType="Control">
                            <Setter Property="Width" Value="0"/>
                            <Setter Property="Height" Value="0"/>
                        </Style>
                    </chartingToolkit:Chart.LegendStyle>
                    <chartingToolkit:Chart.Series>
                        <chartingToolkit:ColumnSeries
                        IndependentValueBinding="{Binding Name}"
                        DependentValueBinding="{Binding Value}"
                        IsSelectionEnabled="True" />
                        <chartingToolkit:ColumnSeries
                        IndependentValueBinding="{Binding Name}"
                        DependentValueBinding="{Binding Value}"
                        IsSelectionEnabled="True" />
                        <chartingToolkit:ColumnSeries
                        IndependentValueBinding="{Binding Name}"
                        DependentValueBinding="{Binding Value}"
                        IsSelectionEnabled="True" />
                    </chartingToolkit:Chart.Series>
                </chartingToolkit:Chart>
            </StackPanel>
            <StackPanel Grid.Row="0" Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
                <chartingToolkit:Chart x:Name="columnChart2">
                    <chartingToolkit:Chart.LegendStyle>
                        <Style TargetType="Control">
                            <Setter Property="Width" Value="0"/>
                            <Setter Property="Height" Value="0"/>
                        </Style>
                    </chartingToolkit:Chart.LegendStyle>
                    <chartingToolkit:Chart.Series>
                        <chartingToolkit:ColumnSeries
                                IndependentValueBinding="{Binding Name}"
                                DependentValueBinding="{Binding Value}"
                                IsSelectionEnabled="True" />
                        <chartingToolkit:ColumnSeries
                                IndependentValueBinding="{Binding Name}"
                                DependentValueBinding="{Binding Value}"
                                IsSelectionEnabled="True" />
                        <chartingToolkit:ColumnSeries
                                IndependentValueBinding="{Binding Name}"
                                DependentValueBinding="{Binding Value}"
                                IsSelectionEnabled="True" />
                    </chartingToolkit:Chart.Series>
                </chartingToolkit:Chart>
            </StackPanel>
    

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“You can stand on the shoulders of giants OR a big enough pile of dwarfs, works either way.”