Apply gradient to AreaSeries

2 posts, 1 answers
  1. FO
    FO avatar
    1 posts
    Member since:
    Jul 2009

    Posted 29 May 2015 Link to this post

    Hello, I wonder if you can apply a color gradient to the AreaSeries chart type? If so, how it should do?
  2. Answer
    Victor avatar
    1349 posts

    Posted 02 Jun 2015 Link to this post

    Hi Francisco,

    Thanks for writing.
    I already answered your question in your support ticket about the same issue.
    Here is the example again, in case some one else is looking for it:
    public class CustomAreaSeries extends AreaSeries {
        public void render(Canvas canvas) {
            Paint paint = new Paint();
            RectF plotArea = Util.convertToRectF(this.chart.getPlotAreaClip());
            paint.setShader(new LinearGradient(plotArea.left, plotArea.centerY(), plotArea.right, plotArea.centerY(), Color.RED, Color.GREEN, Shader.TileMode.CLAMP));
            AreaRendererBase renderer = (AreaRendererBase)this.getRenderer();

    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
  3. DevCraft banner
Back to Top