sparkline 1.0.0 copy "sparkline: ^1.0.0" to clipboard
sparkline: ^1.0.0 copied to clipboard

A Flutter package for sparkline charts.

example/lib/main.dart

import 'dart:math' as math;

import 'package:flutter/material.dart';
import 'package:sparkline/sparkline.dart';

math.Random random = new math.Random();

List<double> _generateRandomData(int count) {
  List<double> result = <double>[];
  for (int i = 0; i < count; i++) {
    result.add(random.nextDouble() * 100);
  }
  return result;
}

void main() {
  var data = _generateRandomData(100);
  Color? lineColor = Colors.lightGreen[500];
  Color? fillColor = Colors.lightGreen[200];
  runApp(
    new MaterialApp(
      home: new Scaffold(
        body: new Center(
          child: new Container(
            width: 300.0,
            height: 100.0,
            child: new Sparkline(
              data: data,
              lineColor: lineColor,
              fillMode: FillMode.below,
              fillColor: fillColor,
              pointsMode: PointsMode.all,
              pointSize: 5.0,
              pointColor: Colors.amber,
            ),
          ),
        ),
      ),
    ),
  );
}
2
likes
120
pub points
77%
popularity

Publisher

unverified uploader

A Flutter package for sparkline charts.

Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (license)

Dependencies

flutter

More

Packages that depend on sparkline