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

Specifying colors for 2-color background pattern

2 Answers 106 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Johan Högberg
Top achievements
Rank 1
Johan Högberg asked on 07 May 2010, 10:22 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Sia
Telerik team
answered on 12 May 2010, 11:50 AM
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.
0
Johan Högberg
Top achievements
Rank 1
answered on 18 Jun 2010, 03:50 PM
It works fine now. Thanks!

// Johan
Tags
Chart
Asked by
Johan Högberg
Top achievements
Rank 1
Answers by
Sia
Telerik team
Johan Högberg
Top achievements
Rank 1
Share this question
or