Overview
The Line Chart displays data trends over time or across ordered categories by connecting individual data points with continuous lines. It is commonly used for tracking changes, comparing multiple datasets, and identifying patterns in time-series or sequential data.
In the Syncfusion Blazor Toolkit, a Line chart is created by setting the Type property of the ChartSeries component to ChartSeriesType.Line. The data is bound using the DataSource, XName, and YName properties. The chart supports markers, tooltips, data labels, real-time updates, axis inversion, and visual customization for analytical dashboards.
Data Label
Data labels display the exact value of each data point directly on the line, improving clarity and reducing the need to rely solely on axis values or tooltips.
In the Blazor Line chart, data labels are enabled by setting the Visible property to true in the ChartDataLabel component. You can further customize their appearance using Format, Font, and ChartDataLabelBorder options to improve readability.
Dashed Line
Dashed lines are useful for distinguishing comparison, projection, or secondary datasets within the same chart.
In the Syncfusion Blazor Toolkit, dashed lines are created by setting the DashArray property in the ChartSeries component. For example, DashArray="4,4" renders a repeating pattern of 4-pixel dashes followed by 4-pixel gaps, providing a clear visual distinction between multiple series.
Reference Line
Reference lines provide visual benchmarks that help compare actual values against targets, thresholds, or key limits.
In a Blazor Line chart, reference lines are rendered using the ChartStriplines collection. Each ChartStripline can define its position using the Start and End properties, apply dashed styling through DashArray, display descriptive text labels via the Text property, and control visibility and layering within the chart area.
Multi-Colored Line
Multi-colored Line charts apply different colors to individual segments of a single line series, making it easier to highlight trends, ranges, or phases within continuous data.
In the Syncfusion Blazor Toolkit, this behavior is enabled by setting the Type property to ChartSeriesType.MultiColoredLine and mapping a color field from the data source using the PointColorMapping property in the ChartSeries component. This approach is ideal for identifying variations without splitting the data into multiple series.
Skip Missing Points
Data points with null or missing values are treated as empty points in the line series. You can control how these gaps are rendered to maintain chart readability.
The ChartEmptyPointSettings component supports multiple modes through the Mode property, including EmptyPointMode.Gap, EmptyPointMode.Zero, EmptyPointMode.Average, and EmptyPointMode.Drop. Each mode defines whether the line breaks, connects, or substitutes values when encountering missing data.
Live Point Update
This sample demonstrates real-time updates in a Line chart, where data points are continuously added while older values are removed to maintain a fixed window.
In the Syncfusion Blazor Toolkit, the chart automatically re-renders whenever the bound data source (e.g., ObservableCollection) changes. This makes Line Charts well-suited for live monitoring scenarios such as telemetry, system metrics, or streaming sensor data.
Inverted Axes
An inverted (transposed) Line Chart swaps the positions of the X-axis and Y-axis, presenting the data in a vertical orientation.
In Blazor charts, this layout is enabled by setting the IsTransposed property of the SfChart component to true. Transposed charts are helpful when working with long category labels or comparing values across a vertical scale.
Negative Data
Line Charts can represent both positive and negative values, making them ideal for visualizing growth, decline, or fluctuations around a baseline.
When negative values are present in the data source, the line naturally dips below the axis, allowing declines or losses to be easily identified. ChartStriplines can be used alongside the series to highlight significant positive or negative thresholds.
Series Customization
Individual line series can be customized to improve clarity and visual distinction when multiple datasets are displayed together.
The ChartSeries component allows you to configure properties such as Fill for color and Width for line thickness. Additionally, you can enable shared tooltips for comparative analysis by setting Shared="true" in the ChartTooltipSettings component.
DataSource Update
This sample demonstrates replacing the entire data source of a Line Chart at regular intervals, rather than incrementally updating individual points.
Full datasource replacement is useful in scenarios such as periodic refreshes, batch-processed results, or recalculated analytics. In Blazor, updating the bound data collection automatically triggers a chart refresh without requiring manual redraw logic. The transition can be animated by enabling the Enable property in ChartSeriesAnimation.