Skip to content
pubscout

chart_sparkline

1.1.3, released 8 days ago by dev.sumsg.com

Beautiful sparkline charts for Flutter with custom lines, points, and fill.

WASM-readyRock solid
$ flutter pub add chart_sparkline
Source repository

What it does

Provides a Sparkline widget to render compact charts for trend lines, high/low values, and averages. Supports features like cubic smoothing, gradients, grid lines, and animations.

AI-written summary of version 1.1.2, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to display simple, clean sparklines or trend lines inside your Flutter UI.
  • You want to highlight maximum, minimum, first, or last values easily.
  • You require custom fills, point markers, or gradients on a small data series.

Skip it when

  • You need complex multi-axis charts, bar charts, or pie charts.
  • You need gesture detection to select the closest point on tap, which is not implemented.

Strengths

  • Simple and lightweight API.
  • Supports custom fill and line gradients.
  • Includes built-in features for averages, grid lines, and min/max markers.

Weaknesses

  • Lacks touch interaction to tap and inspect specific points on the sparkline.
  • Does not support multiple overlapping sparklines on a shared axis.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:flutter/material.dart';
import 'package:chart_sparkline/chart_sparkline.dart';

void main() {
  var data = [0.0, 1.0, 1.5, 2.0, 0.0, 0.0, -0.5, -1.0, -0.5, 0.0, 0.0];
  runApp(
    MaterialApp(
      home: Scaffold(
        body: Center(
          child: Container(
            width: 300.0,
            height: 100.0,
            child: Sparkline(
              data: data,
            ),
          ),
        ),
      ),
    ),
  );
}

Alternatives

Packages that do the same job and could replace chart_sparkline.

  • fl_chart

    Pick fl_chart if you need fully interactive, feature-rich charts with gesture support and multiple chart types.