Specifying colors for 2-color background pattern

3 posts, 1 answers
  1. Johan Högberg
    Johan Högberg avatar
    5 posts
    Member since:
    May 2010

    Posted 07 May 2010 Link to this post

    Hello!

    I'm quite new to both Silverlight and Telerik's controls.
    I'm currently working with the RadChart component creating a bubble chart control
    for the company I'm working for. What I'm trying to do right now is to change the coloring
    of the "color bands" (I've seen it referred to as a "hatch" pattern) in the chart area background.

    I've searched for a while on the net but found nothing that works.
    What I did find on the Telerik website was something like this:

    "To change 2-color pattern background colors, use:
           FillStyle -> FillType -> Hatch
           FillStyle -> MainColor ->
           FillStyle -> SecondColor ->
           FillStyle -> FillSettings -> HatchStyle "

    But that's unfortunately not enough info for me to get the thing working.
    Very thankful for help!

    See the attached picture and the arrows on it to see which colors and color bands I am referring to.

    Regards,

    // Johan

  2. Answer
    Sia
    Admin
    Sia avatar
    755 posts

    Posted 12 May 2010 Link to this post

    Hello Johan Högberg,

    I assume that you are reading wrong section of our help because the things you have tried are not related to our Silverlight chart.

    Please try the following xaml:
    <UserControl x:Class="SilverlightApplication1.MainPage"
        xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
        xmlns:TelerikChart="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
        xmlns:charting="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting">
        
        <Grid x:Name="LayoutRoot">
            <TelerikChart:RadChart x:Name="RadChart1">
                <TelerikChart:RadChart.PaletteBrushes>
                    <RadialGradientBrush>
                        <GradientStop Color="White" Offset="0.837"/>
                        <GradientStop Color="#FFFE0000" Offset="1"/>
                        <GradientStop Color="White" Offset="0.833"/>
                        <GradientStop Color="#FFD0D0D0" Offset="0.786"/>
                        <GradientStop Color="White" Offset="0.023"/>
                    </RadialGradientBrush>
     
                    <RadialGradientBrush>
                        <GradientStop Color="White" Offset="0.837"/>
                        <GradientStop Color="#FF8200FE" Offset="1"/>
                        <GradientStop Color="White" Offset="0.833"/>
                        <GradientStop Color="#FFD0D0D0" Offset="0.786"/>
                        <GradientStop Color="White" Offset="0.023"/>
                    </RadialGradientBrush>
                </TelerikChart:RadChart.PaletteBrushes>
            </TelerikChart:RadChart>
        </Grid>
    </UserControl>
    Just add a BubbleSeries to the RadChart1 and change the gradients.
     
    We introduced the PaletteBrushes property with our 2010.Q1 Release. You can use it in your code behind also. Here you can find more information about it.

    Regards,
    Sia
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Johan Högberg
    Johan Högberg avatar
    5 posts
    Member since:
    May 2010

    Posted 18 Jun 2010 Link to this post

    It works fine now. Thanks!

    // Johan
Back to Top