flutter_candlesticks 0.0.7

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

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

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_large_gridlines.png" width="50%"><img src="https://raw.githubusercontent.com/trentpiercy/flutter-candlesticks/master/screenshots/white_small_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.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
            ),
          ),
        ),
      )
    )
  );
}

1. Depend on it

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


dependencies:
  flutter_candlesticks: "^0.0.7"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

Alternatively, your editor might support pub get or 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.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 Apr 23, 2018, and provided a score, details, and suggestions below. Analysis was completed with status tool failures using:

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6
  • Flutter: 0.3.2

Scores

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

Platforms

Detected platforms: unsure

Error(s) prevent platform classification:

Fix dependencies in pubspec.yaml.

Suggestions

  • Fix dependencies in pubspec.yaml.

    Running flutter packages pub upgrade failed with the following output:

    ERR: The current Flutter SDK version is 0.3.2.
     
     Because flutter_candlesticks requires Flutter SDK version ^0.2.3, version solving failed.
    
  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Fix dependencies in pubspec.yaml.

  • 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