Formatting ComplexGradient

Thread is closed for posting
5 posts, 1 answers
  1. Ryan Hertz
    Ryan  Hertz avatar
    3 posts
    Member since:
    Jun 2009

    Posted 16 Mar 2010 Link to this post

    How can I recreate the following formatting within my VB?

                <Appearance> 
                    <FillStyle FillType="ComplexGradient"
                        <FillSettings> 
                            <ComplexGradient> 
                                <telerik:GradientElement Color="254, 122, 218" /> 
                                <telerik:GradientElement Color="244, 80, 198" Position="0.5" /> 
                                <telerik:GradientElement Color="205, 46, 153" Position="1" /> 
                            </ComplexGradient> 
                        </FillSettings> 
                    </FillStyle> 
                    <TextAppearance TextProperties-Color="51, 51, 51"
                    </TextAppearance> 
                    <Border Color="174, 12, 111" /> 
                </Appearance> 
     

    This is what I've tried with very limited success:

                Dim chartSeries As New Telerik.Charting.ChartSeries() 
                chartSeries.Name = "BUDGET" 
                chartSeries.Type = Telerik.Charting.ChartSeriesType.Bar 
                RadChart1.Series.Add(chartSeries) 
                RadChart1.Series(2).DataYColumn = "budget" 
                'RadChart1.Series(2).Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.ComplexGradient 
                'RadChart1.Series(2).Appearance.FillStyle.FillSettings.ComplexGradient.Item(0).Color = Drawing.Color.Tomato 
                'RadChart1.Series(2).Appearance.FillStyle.FillSettings.ComplexGradient.Item(1).Color = Drawing.Color.Red 
                ' RadChart1.Series(2).Appearance.FillStyle.FillSettings.ComplexGradient.Item(0).Position = 0.5 
                'RadChart1.Series(2).Appearance.FillStyle.FillSettings.ComplexGradient.Item(1).Position = 1 
                RadChart1.Series(2).Appearance.FillStyle.MainColor = Drawing.Color.Tomato 
                RadChart1.Series(2).Appearance.FillStyle.SecondColor = Drawing.Color.Red 
                RadChart1.Series(2).Appearance.TextAppearance.TextProperties.Color = Drawing.Color.Black 
                RadChart1.Series(2).Appearance.Border.Color = Drawing.Color.Tomato 
     


    Thanks in advance,
    Ryan
  2. Answer
    Giuseppe
    Admin
    Giuseppe avatar
    2363 posts

    Posted 18 Mar 2010 Link to this post

    Hi Ryan Hertz,

    You can achieve the desired effect like this:

    Dim series As New ChartSeries()
    series.AddItem(21)
    series.AddItem(11)
    series.AddItem(41)
     
    series.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.ComplexGradient
    series.Appearance.FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.FromArgb(255, 254, 122, 218), 0))
    series.Appearance.FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.FromArgb(255, 244, 80, 198), 0.5F))
    series.Appearance.FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.FromArgb(255, 205, 46, 153), 1))
    series.Appearance.TextAppearance.TextProperties.Color = Color.FromArgb(255, 51, 51, 51)
    series.Appearance.Border.Color = Color.FromArgb(255, 174, 12, 111)
     
    RadChart1.Series.Add(series)

    Hope this helps.


    Best wishes,
    Freddie
    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. Ryan Hertz
    Ryan  Hertz avatar
    3 posts
    Member since:
    Jun 2009

    Posted 18 Mar 2010 Link to this post

    Perfect, thank you.
  4. D
    D avatar
    3 posts
    Member since:
    Mar 2011

    Posted 15 Apr 2011 Link to this post

    Could you provide a C# equivalent?  I've tried a thousand different ways...  thanks!
  5. Missing user
    Missing user avatar

    Posted 20 Apr 2011 Link to this post

    Hi,

    You can use our Code Converter to translate code snippets to C#.

    Greetings,
    Polina
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top