Class RadzenLineSeries<TItem>
A chart series that displays data as a continuous line connecting data points in a RadzenChart. RadzenLineSeries is ideal for showing trends over time, continuous data, or comparing multiple data series. Connects data points with lines, making it easy to visualize trends and patterns. Supports multiple interpolation modes (straight lines, smooth curves, step functions), customizable appearance (color, width, line style), markers at data points, data labels, combination of multiple line series in one chart for comparison, and line styling with different patterns (solid, dashed, dotted). Use CategoryProperty for the X-axis values and ValueProperty for the Y-axis values. Enable Smooth for curved lines, or use Interpolation for more control over line rendering.
Inherited Members
Namespace: Radzen.Blazor
Assembly: Radzen.Blazor.dll
Syntax
public class RadzenLineSeries<TItem> : CartesianSeries<TItem>, IComponent, IHandleEvent, IHandleAfterRender, IChartSeries, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TItem | The type of data items in the series. Each item represents one point on the line. |
Examples
Basic line series:
<RadzenChart>
<RadzenLineSeries Data=@temperatures CategoryProperty="Date" ValueProperty="Temperature" Title="Temperature" />
</RadzenChart>
Smooth line with markers:
<RadzenChart>
<RadzenLineSeries Data=@data CategoryProperty="X" ValueProperty="Y" Smooth="true" Stroke="#FF6384" StrokeWidth="3">
<RadzenMarkers MarkerType="MarkerType.Circle" />
<RadzenSeriesDataLabels Visible="true" />
</RadzenLineSeries>
</RadzenChart>
Constructors
RadzenLineSeries()
A chart series that displays data as a continuous line connecting data points in a RadzenChart. RadzenLineSeries is ideal for showing trends over time, continuous data, or comparing multiple data series. Connects data points with lines, making it easy to visualize trends and patterns. Supports multiple interpolation modes (straight lines, smooth curves, step functions), customizable appearance (color, width, line style), markers at data points, data labels, combination of multiple line series in one chart for comparison, and line styling with different patterns (solid, dashed, dotted). Use CategoryProperty for the X-axis values and ValueProperty for the Y-axis values. Enable Smooth for curved lines, or use Interpolation for more control over line rendering.
Declaration
public RadzenLineSeries()
Examples
Basic line series:
<RadzenChart>
<RadzenLineSeries Data=@temperatures CategoryProperty="Date" ValueProperty="Temperature" Title="Temperature" />
</RadzenChart>
Smooth line with markers:
<RadzenChart>
<RadzenLineSeries Data=@data CategoryProperty="X" ValueProperty="Y" Smooth="true" Stroke="#FF6384" StrokeWidth="3">
<RadzenMarkers MarkerType="MarkerType.Circle" />
<RadzenSeriesDataLabels Visible="true" />
</RadzenLineSeries>
</RadzenChart>
Properties
Color
Gets the color.
Declaration
public override string Color { get; }
Property Value
| Type | Description |
|---|---|
| string | The color. |
Overrides
Interpolation
Gets or sets the interpolation method used to render lines between data points. Options include Line (straight lines), Spline (smooth curves), and Step (stair-step lines).
Declaration
[Parameter]
public Interpolation Interpolation { get; set; }
Property Value
| Type | Description |
|---|---|
| Interpolation | The interpolation method. Default is Line. |
LineType
Gets or sets the line style pattern (solid, dashed, dotted). Use LineType.Dashed or LineType.Dotted to create non-solid lines for visual distinction or to represent projected/estimated data.
Declaration
[Parameter]
public LineType LineType { get; set; }
Property Value
| Type | Description |
|---|---|
| LineType | The line style. Default is solid. |
Smooth
Gets or sets whether to render smooth curved lines between data points instead of straight lines. When true, uses spline interpolation to create smooth curves. This is a convenience property for setting Interpolation to Spline.
Declaration
[Parameter]
public bool Smooth { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
|
Stroke
Gets or sets the color of the line. Supports any valid CSS color value (e.g., "#FF0000", "rgb(255,0,0)", "var(--my-color)"). If not set, uses the color from the chart's color scheme.
Declaration
[Parameter]
public string Stroke { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The line color as a CSS color value. |
StrokeWidth
Gets or sets the width of the line in pixels. Thicker lines are more visible but may obscure details in dense data.
Declaration
[Parameter]
public double StrokeWidth { get; set; }
Property Value
| Type | Description |
|---|---|
| double | The line width in pixels. Default is 2. |
Methods
BuildRenderTree(RenderTreeBuilder)
A chart series that displays data as a continuous line connecting data points in a RadzenChart. RadzenLineSeries is ideal for showing trends over time, continuous data, or comparing multiple data series. Connects data points with lines, making it easy to visualize trends and patterns. Supports multiple interpolation modes (straight lines, smooth curves, step functions), customizable appearance (color, width, line style), markers at data points, data labels, combination of multiple line series in one chart for comparison, and line styling with different patterns (solid, dashed, dotted). Use CategoryProperty for the X-axis values and ValueProperty for the Y-axis values. Enable Smooth for curved lines, or use Interpolation for more control over line rendering.
Declaration
protected override void BuildRenderTree(RenderTreeBuilder __builder)
Parameters
| Type | Name | Description |
|---|---|---|
| RenderTreeBuilder | __builder |
Overrides
Contains(double, double, double)
Determines if the series contains the specified coordinates with a given tolerance.
Declaration
public override bool Contains(double x, double y, double tolerance)
Parameters
| Type | Name | Description |
|---|---|---|
| double | x | The x. |
| double | y | The y. |
| double | tolerance | The tolerance. |
Returns
| Type | Description |
|---|---|
| bool |
|
Overrides
GetDataLabels(double, double)
Returns data chart position
Declaration
public override IEnumerable<ChartDataLabel> GetDataLabels(double offsetX, double offsetY)
Parameters
| Type | Name | Description |
|---|---|---|
| double | offsetX | |
| double | offsetY |
Returns
| Type | Description |
|---|---|
| IEnumerable<ChartDataLabel> |
Overrides
Render(ScaleBase, ScaleBase)
Renders the series with the specified category and value scales.
Declaration
public override RenderFragment Render(ScaleBase categoryScale, ScaleBase valueScale)
Parameters
| Type | Name | Description |
|---|---|---|
| ScaleBase | categoryScale | The category scale. |
| ScaleBase | valueScale | The value scale. |
Returns
| Type | Description |
|---|---|
| RenderFragment | RenderFragment. |
Overrides
TooltipStyle(TItem)
Gets the tooltip inline style.
Declaration
protected override string TooltipStyle(TItem item)
Parameters
| Type | Name | Description |
|---|---|---|
| TItem | item | The item. |
Returns
| Type | Description |
|---|---|
| string |