flutter_candlesticks 0.1.2

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

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.
increaseColorDefault Colors.green. Color of increasing candles.
decreaseColorDefault Colors.red. Color of decreasing candles.

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.1.2] - 2018-08-31

  • Update version constraints for Dart 2.1.0

[0.1.1] - 2018-08-06

  • Added increaseColor and decreaseColor options

[0.1.0] - 2018-07-09

  • Fix gridLineWidth not being used
  • Better grid line label text handling

[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.1.2

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.1.2 Aug 31, 2018 Go to the documentation of flutter_candlesticks 0.1.2 Download flutter_candlesticks 0.1.2 archive
0.1.1 Aug 6, 2018 Go to the documentation of flutter_candlesticks 0.1.1 Download flutter_candlesticks 0.1.1 archive
0.1.0 Jul 10, 2018 Go to the documentation of flutter_candlesticks 0.1.0 Download flutter_candlesticks 0.1.0 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

All 12 versions...

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

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

  • Dart: 2.0.0
  • pana: 0.12.4
  • Flutter: 0.9.5

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.23.0 <=3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test