flutter_candlesticks 0.0.9

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 79

pub package

flutter_candlesticks

Elegant OHLC Candlestick and Trade Volume charts for Flutter

Usage

Install for Flutter with pub.

PropertyDescription
dataRequired. List of maps containing open, high, low, close and volumeto
enableGridLinesRequired. Enable or disable grid lines
volumePropRequired. Proportion of container to be given to volume bars
lineWidthDefault 1.0. Width of most lines
gridLineAmountDefault 5. Number of grid lines to draw. Labels automatically assigned
gridLineWidthDefault 0.5. Width of grid lines
gridLineColorDefault Colors.grey. Color of grid lines
gridLineLabelColorDefault Colors.grey. Color of grid line labels
labelPrefixDefault "$". Prefix before grid line labels.

Examples

No Grid Lines

new OHLCVGraph(
    data: sampleData,
    enableGridLines: false,
    volumeProp: 0.2
    )
)

<img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/white_large.png" width="50%"><img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/dark_large.png" width="50%">

Candle size dynamically changes by amount of data

<img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/white_small.png" width="50%"><img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/dark_small.png" width="50%">

Grid Lines

new OHLCVGraph(
    data: sampleData,
    enableGridLines: true,
    volumeProp: 0.2,
    gridLineAmount: 5,
    gridLineColor: Colors.grey[300],
    gridLineLabelColor: Colors.grey
    )
)

<img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/white_small_gridlines.png" width="50%"><img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/dark_large_gridlines.png" width="50%">

Full App Example

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

void main() {
  List sampleData = [
    {"open":50.0, "high":100.0, "low":40.0, "close":80, "volumeto":5000.0},
    {"open":80.0, "high":90.0, "low":55.0, "close":65, "volumeto":4000.0},
    {"open":65.0, "high":120.0, "low":60.0, "close":90, "volumeto":7000.0},
    {"open":90.0, "high":95.0, "low":85.0, "close":80, "volumeto":2000.0},
    {"open":80.0, "high":85.0, "low":40.0, "close":50, "volumeto":3000.0},
  ];

  runApp(
    new MaterialApp(
      home: new Scaffold(
        body: new Center(
          child: new Container(
            height: 500.0,
            child: new OHLCVGraph(
                data: sampleData,
                enableGridLines: false,
                volumeProp: 0.2
            ),
          ),
        ),
      )
    )
  );
}

[0.0.9] - 2018-04-26

  • Fix label value bug
  • Added labelPrefix param

[0.0.8] - 2018-04-26

  • Update to Flutter SDK 0.3.1

[0.0.7] - 2018-04-20

  • Moved labels to right of grid lines

[0.0.6] - 2018-04-12

  • Improved labeling efficiency

[0.0.5] - 2018-04-10

  • Corrected README.md

[0.0.4] - 2018-04-10

  • Fix screenshots for pub

[0.0.3] - 2018-04-10

  • Update README.md
  • Screenshots
  • Fix volume label color

[0.0.2] - 2018-04-10

  • LICENSE
  • Example

[0.0.1] - 2018-04-09

  • Initial Release

example/example.dart

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

void main() {
  List sampleData = [
    {"open":50.0, "high":100.0, "low":40.0, "close":80, "volumeto":5000.0},
    {"open":80.0, "high":90.0, "low":55.0, "close":65, "volumeto":4000.0},
    {"open":65.0, "high":120.0, "low":60.0, "close":90, "volumeto":7000.0},
    {"open":90.0, "high":95.0, "low":85.0, "close":80, "volumeto":2000.0},
    {"open":80.0, "high":85.0, "low":40.0, "close":50, "volumeto":3000.0},

    {"open":50.0, "high":100.0, "low":40.0, "close":80, "volumeto":5000.0},
    {"open":80.0, "high":90.0, "low":55.0, "close":65, "volumeto":4000.0},
    {"open":65.0, "high":120.0, "low":60.0, "close":90, "volumeto":7000.0},
    {"open":90.0, "high":95.0, "low":85.0, "close":80, "volumeto":2000.0},
    {"open":80.0, "high":85.0, "low":40.0, "close":50, "volumeto":3000.0},

    {"open":50.0, "high":100.0, "low":40.0, "close":80, "volumeto":5000.0},
    {"open":80.0, "high":90.0, "low":55.0, "close":65, "volumeto":4000.0},
    {"open":65.0, "high":120.0, "low":60.0, "close":90, "volumeto":7000.0},
    {"open":90.0, "high":95.0, "low":85.0, "close":80, "volumeto":2000.0},
    {"open":80.0, "high":85.0, "low":40.0, "close":50, "volumeto":3000.0},
  ];

  runApp(
    new MaterialApp(
      home: new Scaffold(
        body: new Center(
          child: new Container(
            height: 500.0,
            child: new OHLCVGraph(
                data: sampleData,
                enableGridLines: false,
                volumeProp: 0.2
            ),
          ),
        ),
      )
    )
  );
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_candlesticks: "^0.0.9"

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


      import 'package:flutter_candlesticks/flutter_candlesticks.dart';
  
Version Uploaded Documentation Archive
0.0.9 Apr 27, 2018 Go to the documentation of flutter_candlesticks 0.0.9 Download flutter_candlesticks 0.0.9 archive
0.0.8 Apr 26, 2018 Go to the documentation of flutter_candlesticks 0.0.8 Download flutter_candlesticks 0.0.8 archive
0.0.7 Apr 20, 2018 Go to the documentation of flutter_candlesticks 0.0.7 Download flutter_candlesticks 0.0.7 archive
0.0.6 Apr 12, 2018 Go to the documentation of flutter_candlesticks 0.0.6 Download flutter_candlesticks 0.0.6 archive
0.0.5 Apr 11, 2018 Go to the documentation of flutter_candlesticks 0.0.5 Download flutter_candlesticks 0.0.5 archive
0.0.4 Apr 11, 2018 Go to the documentation of flutter_candlesticks 0.0.4 Download flutter_candlesticks 0.0.4 archive
0.0.3 Apr 11, 2018 Go to the documentation of flutter_candlesticks 0.0.3 Download flutter_candlesticks 0.0.3 archive
0.0.2 Apr 10, 2018 Go to the documentation of flutter_candlesticks 0.0.2 Download flutter_candlesticks 0.0.2 archive
0.0.1 Apr 10, 2018 Go to the documentation of flutter_candlesticks 0.0.1 Download flutter_candlesticks 0.0.1 archive

Analysis

We analyzed this package on Jun 19, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0-dev.63.0
  • pana: 0.11.3
  • Flutter: 0.5.4

Scores

Popularity:
Describes how popular the package is relative to other packages. [more]
58 / 100
Health:
Code health derived from static analysis. [more]
100 / 100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100 / 100
Overall score:
Weighted score of the above. [more]
79
Learn more about scoring.

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Suggestions

  • Package is pre-v1 release.

    While there is nothing inherently wrong with versions of 0.*.*, it usually means that the author is still experimenting with the general direction API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <=2.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.6 1.14.10
meta 1.1.5
sky_engine 0.0.99
typed_data 1.1.5
vector_math 2.0.6 2.0.7
Dev dependencies
flutter_test