Class StockChartLinearGradient
Provides options to configure a linear gradient for a stock chart StockChartSeries, technical StockChartIndicator, or StockChartTrendline within the SfStockChart component.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Charts
Assembly: Syncfusion.Blazor.dll
Syntax
public class StockChartLinearGradient : LinearGradient, IComponent, IHandleEvent, IHandleAfterRender, IDisposable
Remarks
StockChartLinearGradient is a child component that inherits from LinearGradient. Set the gradient vector using X1, Y1, X2, and Y2; define color transitions using Syncfusion.Blazor.Charts.StockChartLinearGradient.StockChartGradientColorStops with one or more StockChartGradientColorStop elements.
Coordinates for X1/Y1/X2/Y2 are typically normalized to 0..1 relative to the element’s paint box (series, indicator, or trendline),
where (0,0) is the top-left and (1,1) is the bottom-right. Gradient stop Offset commonly supports normalized values
(0..1) or percentage values (0..100).
When nested under StockChartSeries, StockChartIndicator, or StockChartTrendline, the gradient is applied automatically to the owning element.
Examples
@using Syncfusion.Blazor.Charts
<SfStockChart>
<StockChartSeriesCollection>
<StockChartSeries Type="ChartSeriesType.Line"
XName="Date"
YName="Close"
Name="Price">
<StockChartLinearGradient X1="0" Y1="0" X2="1" Y2="0">
<StockChartGradientColorStops>
<StockChartGradientColorStop Offset="0" Color="#42A5F5" Opacity="1" />
<StockChartGradientColorStop Offset="100" Color="#1E88E5" Opacity="1" />
</StockChartGradientColorStops>
</StockChartLinearGradient>
<StockChartTrendlines>
<StockChartTrendline Type="TrendlineTypes.Linear" Width="2" Name="Trend">
<StockChartLinearGradient X1="0" Y1="1" X2="1" Y2="0">
<StockChartGradientColorStops>
<StockChartGradientColorStop Offset="0" Color="#22C55E" Opacity="1" />
<StockChartGradientColorStop Offset="100" Color="#16A34A" Opacity="1" />
</StockChartGradientColorStops>
</StockChartLinearGradient>
</StockChartTrendline>
</StockChartTrendlines>
</StockChartSeries>
</StockChartSeriesCollection>
</SfStockChart>
Constructors
StockChartLinearGradient()
Declaration
public StockChartLinearGradient()
Methods
BuildRenderTree(RenderTreeBuilder)
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |