fcharts 0.0.11

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

fcharts #

Build Status Pub Status

A work-in-progress chart library for Flutter. Until version 1.0.0 the API is subject to change drastically. Needless to say, fcharts is not production ready.

The goal of this project is to allow for creating beautiful, responsive charts using a simple and intuitive API.

Inspired by Mikkel Ravn's tutorial on Flutter widgets and animations. If you have used Recharts (ReactJS library) you will find the high level API to be somewhat familiar.

Demo #

Bar chart demo Touch demo

Example Usage #

class SimpleLineChart extends StatelessWidget {
  // X value -> Y value
  static const myData = [
    ["A", "✔"],
    ["B", "❓"],
    ["C", "✖"],
    ["D", "❓"],
    ["E", "✖"],
    ["F", "✖"],
    ["G", "✔"],
  ];
  
  @override
  Widget build(BuildContext context) {
    return new LineChart(
      lines: [
        new Line<List<String>, String, String>(
          data: myData,
          xFn: (datum) => datum[0],
          yFn: (datum) => datum[1],
        ),
      ],
      chartPadding: new EdgeInsets.fromLTRB(30.0, 10.0, 10.0, 30.0),
    );
  }
}

The above code creates:

line chart

0.0.9 - 0.0.10 #

  • Fix for latest Dart/Flutter updates
  • Dispose animation controller
  • Improved bar chart support

Note: Next updates will be focused on an improved API, better bar chart support, and interactive charts. I've got some additional time to dedicate to the library.

0.0.8 #

  • Added more examples
  • Wrapped up automatic span calculation

0.0.7 #

  • New API for creating a line chart widget

0.0.5 - 0.0.6 #

  • Begin adding tests
  • dartfmt

0.0.2 - 0.0.4 #

Just dependency, documentation, and format fixes.

0.0.1 #

Started the project!

  • Chart, a widget for creating a viewable chart from meaningful params
  • ChartData for creating a drawable
  • ChartDrawable for drawing directly to a canvas

example/README.md

fcharts_example #

Demonstrates how to use the fcharts plugin.

See lib/line for example charts.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  fcharts: ^0.0.11

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:fcharts/fcharts.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
86
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4

Health suggestions

Fix lib/src/widgets/bar_chart.dart. (-1.99 points)

Analysis of lib/src/widgets/bar_chart.dart reported 4 hints:

line 4 col 8: Unused import: 'package:fcharts/src/decor/axis.dart'.

line 5 col 8: Unused import: 'package:fcharts/src/decor/decor.dart'.

line 6 col 8: Unused import: 'package:fcharts/src/utils/chart_position.dart'.

line 13 col 8: Unused import: 'dart:math'.

Fix lib/src/utils/monotone_interpolator.dart. (-0.50 points)

Analysis of lib/src/utils/monotone_interpolator.dart reported 1 hint:

line 61 col 11: Name non-constant identifiers using lowerCamelCase.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.28.0 <3.0.0
collection ^1.14.5 1.14.11 1.14.12
flutter 0.0.0
meta ^1.1.2 1.1.8
Transitive dependencies
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test
test ^1.3.0