area chart gradient help

Thread is closed for posting
2 posts, 0 answers
  1. derrick
    derrick avatar
    2 posts
    Member since:
    Sep 2015

    Posted 02 Sep 2015 Link to this post

    Can a gradient be applied to an area chart? I'm looking at the iOS demo app and the double curved area chart example has very faint gradients for the red and blue (see attahced). Can I specify what the gradient range should be with "hard" hex values or is there a way to define 1 hex value with opacity or alpha values, like 100% - 40% ? 

    In the attached image the red is #fff3f3 (lightest) at the top -to- fbdfdd (darker)
  2. Sophi
    Sophi avatar
    103 posts

    Posted 03 Sep 2015 Link to this post

    Hi Derrick,

    Thank you for contacting us.

    Yes, gradient can be applied on area chart. The gradients from the image are the default area colors that the chart uses, you can set your custom fill through the palette property of the series. Consider the following code snippet.
    TKLinearGradientFill *fill = [TKLinearGradientFill
                                      linearGradientFillWithColors:@[[UIColor colorWithRed:0.f green:1.f blue:0.f alpha:0.6f],
                                                                     [UIColor colorWithRed:1.f green:0.f blue:0.f alpha:0.6f],
                                                                     [UIColor colorWithRed:0.f green:0.f blue:1.f alpha:0.6f]]]; = [TKChartPalette new];
        TKChartPaletteItem *item = [[TKChartPaletteItem alloc] initWithFill:fill];
        [ addPaletteItem:item];
    You can read more about chart customizations in our online documentation. One of the topics in this article is exactly working with fills including gradients.

    I hope this covers your case.
    If you have any other questions, do not hesitate to contact us.

    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 Feedback Portal and vote to affect the priority of the items
Back to Top