Gradient color in chart series

1 Answer 141 Views
Charts
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Ilan asked on 16 Aug 2022, 11:40 AM

I was able to make a gradient color Chart Area when RenderingMode is SVG.  But it's not working on RenderingMode.Canvas.

What do I need to change?

What I use is:

<ChartSeries Color="url(#svg-gradient)"

where:

<svg xmlns="https://www.w3.org/2000/svg" version="1.1" width="0" height="0" style="visibility: hidden">

<defs>
<linearGradient id="svg-gradient" x1="0%" y1="0%" x2="0%" y2="100%">
<stop offset="0%" style="stop-color: #c2dc8b; stop-opacity: 1.0"/>
<stop offset="100%" style="stop-color: #c2dc8b; stop-opacity: 0.1"/>
</linearGradient>
</defs>
</svg>

1 Answer, 1 is accepted

Sort by
0
Joana
Telerik team
answered on 19 Aug 2022, 04:48 AM

Hello Ilan,

We provide a built-in support for Series Gradient. You might observethe behavior in the following REPL snippet, or our API Reference:

https://blazorrepl.telerik.com/QmaWPXEI41Pt7Zjf32 

https://docs.telerik.com/blazor-ui/api/Telerik.Blazor.Components.ChartSeriesOverlay#collapsible-Telerik_Blazor_Components_ChartSeriesOverlay_Gradient

https://docs.telerik.com/blazor-ui/api/Telerik.Blazor.ChartSeriesOverlayGradient 

In SVG RenderMode it is possible to apply external custom gradient. However, in Canvas mode it needs to be drawed by the chart engine.  

Regards,
Joana
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Paul
Top achievements
Rank 1
commented on 22 Sep 2022, 05:59 PM

Could you please provide an example of applying an external gradient using SVG RenderMode?
Marin Bratanov
Telerik team
commented on 25 Sep 2022, 08:25 AM

The opener post by Ilan has one. It relies on the standard svg url() and <defs> features
Tags
Charts
Asked by
Ilan
Top achievements
Rank 1
Bronze
Iron
Veteran
Answers by
Joana
Telerik team
Share this question
or