start_chart 0.2.0

Start Chart #

Start Chart is a simple charting package for web framework. There are good charting packages for Flutter mobile UI framework such as google charts. But, it lacks simple architecture for web framework. Also, it lacks candle charts with technical indicators.

Thus, I've made charting packages supporting web framework and candle charts.

demo

See the start examples for supported chart examples.

Example usage #

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {

  @override
  Widget build(BuildContext context) {

    return MaterialApp(
      title: 'Chart Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: ChartPage(),
      debugShowCheckedModeBanner: false,
    );
  }
}

class ChartPage extends StatelessWidget {
  List<double> points = [
    50, 90, 1003, 500, 150, 120, 200, 80
  ];

  List<String> labels = [
    "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2020"
  ];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Chart Page"),
      ),
      body: Container(
        padding: const EdgeInsets.symmetric(vertical: 8.0),
        child: Center(
          child: Column(
            children: <Widget>[
              LineChart(data: points),
              Padding(padding: const EdgeInsets.symmetric(vertical: 4.0)),
              PieChart(percentage: 55),
              Padding(padding: const EdgeInsets.symmetric(vertical: 8.0)),
              BarChart(data: points, labels : labels),
            ],
          ),
        ),
      ),
    );
  }
}

Bar

bar

Candle

candle

Line

line

Pie

pie

Credits #

MFW ( https://github.com/OpenFlutter/k_chart ).

Copyright (c) 2020 Benjamin Jung bsjung@gmail.com.

Use this package as a library

1. Depend on it

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


dependencies:
  start_chart: ^0.2.0

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:start_chart/start_chart.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
34
Health:
Code health derived from static analysis. [more]
92
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
61
Learn more about scoring.

We analyzed this package on Mar 27, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health suggestions

Fix lib/chart/candle/renderer/secondary_renderer.dart. (-2.96 points)

Analysis of lib/chart/candle/renderer/secondary_renderer.dart reported 6 hints, including:

line 82 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 86 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 90 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 101 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 105 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

Fix lib/chart/candle/renderer/main_renderer.dart. (-1.49 points)

Analysis of lib/chart/candle/renderer/main_renderer.dart reported 3 hints:

line 51 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 55 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

line 59 col 11: The for, if, and spread elements weren't supported until version 2.3.0, but this code is required to be able to run on earlier versions.

Fix lib/chart/utils/data_util.dart. (-1.49 points)

Analysis of lib/chart/utils/data_util.dart reported 3 hints:

line 3 col 8: Unused import: '../utils/number_util.dart'.

line 152 col 16: Name non-constant identifiers using lowerCamelCase.

line 153 col 16: Name non-constant identifiers using lowerCamelCase.

Fix additional 14 files with analysis or formatting issues. (-2.50 points)

Additional issues in the following files:

  • lib/chart/candle/renderer/vol_renderer.dart (2 hints)
  • lib/chart/bar/bar_widget.dart (1 hint)
  • lib/chart/line/line_widget.dart (1 hint)
  • lib/chart/pie/pie_widget.dart (1 hint)
  • lib/chart/bar/renderer/bar_renderer.dart (Run flutter format to format lib/chart/bar/renderer/bar_renderer.dart.)
  • lib/chart/bar_chart.dart (Run flutter format to format lib/chart/bar_chart.dart.)
  • lib/chart/candle/candle_widget.dart (Run flutter format to format lib/chart/candle/candle_widget.dart.)
  • lib/chart/candle/entity/entity.dart (Run flutter format to format lib/chart/candle/entity/entity.dart.)
  • lib/chart/candle/renderer/base_candle_painter.dart (Run flutter format to format lib/chart/candle/renderer/base_candle_painter.dart.)
  • lib/chart/candle_chart.dart (Run flutter format to format lib/chart/candle_chart.dart.)
  • lib/chart/line/renderer/line_renderer.dart (Run flutter format to format lib/chart/line/renderer/line_renderer.dart.)
  • lib/chart/line_chart.dart (Run flutter format to format lib/chart/line_chart.dart.)
  • lib/chart/pie/renderer/pie_renderer.dart (Run flutter format to format lib/chart/pie/renderer/pie_renderer.dart.)
  • lib/chart/pie_chart.dart (Run flutter format to format lib/chart/pie_chart.dart.)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Maintain an example.

None of the files in the package's example/ directory matches known example patterns.

Common filename patterns include main.dart, example.dart, and start_chart.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

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