Skip to content
ChartForgeX

Trend Line examples in C#

Trend Line examples rendered by ChartForgeX: a live chart, variants in light and dark themes, the C# source and the options to configure it.

All charts Trends and rangesScatterTrendLine

Request volume and its trend

The interactive HTML page ChartForgeX writes for this chart. Hover for values, click legend items to hide or show series, use the keyboard to navigate, and right-click for export and reset. Where the chart can redraw a zoomed range, use the wheel to zoom, choose Pan to move the window, or choose Brush and drag to zoom to a range.

Build it in C#

This is the code for the chart above. Show setup adds the imports before it and the few lines that write SVG, PNG and HTML after it, so it reads as one program; the download is the complete console program, ready to run with the ChartForgeX package.

C# Program.cs Download
Loading source…

Variants

Options

Common ChartTrendLineOptions builder calls for this family. Every member is listed in the API reference.

MethodWhat it does
ModelGets or sets the fit model. Linear preserves the existing least-squares endpoint behavior.
PolynomialDegreeGets or sets the Polynomial model's degree, either two or three. The default is two.
IntervalGets or sets the optional pointwise interval. The default is None.
ConfidenceLevelGets or sets the pointwise confidence level, from 0.5 through 0.999. The default is 0.95.
SampleCountGets or sets uniform source-X samples, from 17 through 513. The default is 129.