TerraFluent.Chart.Reporting

Spline Chart in C#

Render smooth spline curves in C# with AddSpline — true Bézier interpolation, self-contained SVG, zero dependencies. Part of TerraFluent.Chart.Reporting.

Spline Chart

Smooth spline curves — temperature trends for three cities.

Temperature Trends — Daily avg °C — Summer 2025 Temperature Trends — Daily avg °C — Summer 2025 — Series: London, Madrid, Helsinki. Categories: W1 to W8. Values range from 14 to 40. Temperature Trends Daily avg °C — Summer 2025 0 10 20 30 40 Temperature (°C) W1 W2 W3 W4 W5 W6 W7 W8 Week London: 18 London: 20 London: 22 London: 25 London: 27 London: 24 London: 21 London: 19 Madrid: 28 Madrid: 31 Madrid: 34 Madrid: 38 Madrid: 40 Madrid: 37 Madrid: 33 Madrid: 30 Helsinki: 14 Helsinki: 16 Helsinki: 18 Helsinki: 20 Helsinki: 22 Helsinki: 21 Helsinki: 17 Helsinki: 14 London Madrid Helsinki terrafluent.dev terrafluent.dev

True Spline (Bézier)

Catmull-Rom cubic Bézier curves.

Smooth Spline — Catmull-Rom Bézier — ChartType.Spline uses cubic Bézier control points Smooth Spline — Catmull-Rom Bézier — ChartType.Spline uses cubic Bézier control points — Series: London, Madrid, Helsinki. Categories: W1 to W8. Values range from 14 to 40. Smooth Spline — Catmull-Rom Bézier ChartType.Spline uses cubic Bézier control points 0 10 20 30 40 Temperature (°C) W1 W2 W3 W4 W5 W6 W7 W8 Week London: 18 London: 20 London: 22 London: 25 London: 27 London: 24 London: 21 London: 19 Madrid: 28 Madrid: 31 Madrid: 34 Madrid: 38 Madrid: 40 Madrid: 37 Madrid: 33 Madrid: 30 Helsinki: 14 Helsinki: 16 Helsinki: 18 Helsinki: 20 Helsinki: 22 Helsinki: 21 Helsinki: 17 Helsinki: 14 London Madrid Helsinki terrafluent.dev terrafluent.dev

When to use a spline chart

Reach for it when

  • Data that genuinely varies continuously between samples — temperature, pressure, a physical signal.
  • Presentation charts where the eye should follow one overall shape rather than each segment.
  • Smoothed or modelled output, where the curve is already an interpolation and drawing it as one is honest.

Use something else when

  • Discrete measurements. A spline invents values between your points and can overshoot past the real maximum, which reads as data you never recorded.
  • Any chart where the exact value at a point matters — the curve does not pass through the sample as visibly as a straight segment does.
  • Sparse series. With four points a spline is mostly invention; use AddLine.

Spline Chart in C#

Lifted verbatim from the chart types reference, so it compiles against the shipped API. See the API reference for every overload and the exact data types each series method accepts.

string svg = ChartBuilder.Create()
    .Title("Temperature Trends — Smooth Spline")
    .Size(700, 400)
    .XAxis("Week", "W1","W2","W3","W4","W5","W6","W7","W8")
    .YAxis("Temperature (°C)")
    .AsAnimated()
    .Series(s => s
        .AddSpline("London", new double[] { 18, 20, 22, 25, 27, 24, 21, 19 },
            cfg => cfg.Color(ChartColor.ChartBlue))
        .AddSpline("Madrid", new double[] { 28, 31, 34, 38, 40, 37, 33, 30 },
            cfg => cfg.Color(ChartColor.ChartOrange)))
    .RenderToSvg();

Install

dotnet add package TerraFluent.Chart.Reporting
  • MIT licensed — free for commercial use, no chart limits, no watermarks.
  • Zero dependencies — nothing but the .NET base class library.
  • netstandard2.0 through net10.0 — .NET Framework 4.6.1+, .NET Core 2.0+, and every modern release.
  • Output is one SVG string — embed it in HTML, a PDF, or a Word document.