Elegant OHLC Candlestick and Trade Volume charts for @Flutter

Overview

pub package

flutter_candlesticks

Elegant OHLC Candlestick and Trade Volume charts for Flutter

Usage

Install for Flutter with pub.

Property Description
data Required. List of maps containing open, high, low, close and volumeto
enableGridLines Required. Enable or disable grid lines
volumeProp Required. Proportion of container to be given to volume bars
lineWidth Default 1.0. Width of most lines
gridLineAmount Default 5. Number of grid lines to draw. Labels automatically assigned
gridLineWidth Default 0.5. Width of grid lines
gridLineColor Default Colors.grey. Color of grid lines
gridLineLabelColor Default Colors.grey. Color of grid line labels
labelPrefix Default "$". Prefix before grid line labels.
increaseColor Default Colors.green. Color of increasing candles.
decreaseColor Default Colors.red. Color of decreasing candles.

Examples

No Grid Lines

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

Candle size dynamically changes by amount of data

Grid Lines

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

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
            ),
          ),
        ),
      )
    )
  );
}
Comments
  • parameterized colors (also volume override)

    parameterized colors (also volume override)

    because I like me candles to be fully greeeen ;)

    also used PaintingStyle to draw the outlines automagically

    and added volumePaint, if null, will use candle colors

    OHLCVGraph(
                data: _coinChartData,
                enableGridLines: true,
                volumeProp: 15/100,
                labelPrefix: "\$",
                gridLineAmount: 10,
                gridLineColor: Colors.grey[300],
                gridLineLabelColor: Colors.grey,
                greenPaint: new Paint()
                  ..color = Colors.green
                  ..strokeWidth = 1.0
                  ..style = PaintingStyle.fill,
                volumePaint: new Paint()
                  ..color = Colors.grey
                  ..style = PaintingStyle.stroke,
    
    iphone_x_-_11_4
    opened by benoitjadinon 2
  • Doesn't work on flutter 0.3.1

    Doesn't work on flutter 0.3.1

    when running my app I get this:

    The current Flutter SDK version is 0.3.1.

    Because flutter_candlesticks 0.0.7 requires Flutter SDK version ^0.2.3 and no versions of flutter_candlesticks match >0.0.7 <0.1.0, flutter_candlesticks ^0.0.7 is forbidden. So, because frypto depends on flutter_candlesticks ^0.0.7, version solving failed. pub get failed (1)

    opened by BPHvZ 2
  • Not work on flutter 0.7.5

    Not work on flutter 0.7.5

    The current Dart SDK version is 2.1.0-dev.0.0.flutter-be6309690f.

    Because depends on flutter_candlesticks >=0.0.2 which requires SDK version >=1.23.0 <=2.0.0, version solving failed.

    opened by lovestorymeetsvivalavida 1
  • Function request

    Function request

    It would be awesome if the ticker/label (aka dollar sign) could be changed so that the chart could load data in other currencies without having the dollar sign as the price.

    And selection callback would be amazing! like this: https://google.github.io/charts/flutter/example/interactions/selection_callback_example

    These are just ideas to make this plugin even better

    opened by BPHvZ 1
  • The getter 'text' isn't defined for the class 'InlineSpan'.

    The getter 'text' isn't defined for the class 'InlineSpan'.

    /C:/src/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_candlesticks-0.1.4/lib/flutter_candlesticks.dart:190:57: Error: The getter 'text' isn't defined for the class 'InlineSpan'.

    • 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/C:/src/flutter/packages/flutter/lib/src/painting/inline_span.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. width = size.width - gridLineTextPainters[0].text.text.length * 6;

    I'm getting this error. if anyone knows it , please help here.

    opened by LogicRepo 2
  • Build error with recent Flutter

    Build error with recent Flutter

    Running Gradle task 'assembleDebug'... /data/dev/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_candlesticks-0.1.4/lib/flutter_candlesticks.dart:190:57: Error: The getter 'text' isn't defined for the class 'InlineSpan'.

    • 'InlineSpan' is from 'package:flutter/src/painting/inline_span.dart' ('/data/dev/flutter/packages/flutter/lib/src/painting/inline_span.dart'). Try correcting the name to the name of an existing getter, or defining a getter or field named 'text'. width = size.width - gridLineTextPainters[0].text.text.length * 6; ^^^^

    FAILURE: Build failed with an exception.

    • Where: Script '/data/dev/flutter/packages/flutter_tools/gradle/flutter.gradle' line: 991

    • What went wrong: Execution failed for task ':app:compileFlutterBuildDebug'.

    Process 'command '/data/dev/flutter/bin/flutter'' finished with non-zero exit value 1

    • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

    • Get more help at https://help.gradle.org

    BUILD FAILED in 10s Exception: Gradle task assembleDebug failed with exit code 1

    opened by Tahaan 6
Tiny charts 🤏 - Sparkline charts for fast data visualization on Flutter apps

Tiny charts ?? - Sparkline charts for fast data visualization on Flutter apps

rows 15 Dec 10, 2022
A simple candlestick chart for flutter. Supports smooth scroll and zoom

simple_candlestick_chart A simple candlestick chart for flutter. Supports smooth

7c00 14 Oct 17, 2022
Animated radial and pie charts for Flutter

Flutter Circular Chart A library for creating animated circular chart widgets with Flutter, inspired by Zero to One with Flutter. Overview Create easi

Victor Choueiri 387 Dec 26, 2022
Flutter chart library contains depth charts supporting various indicators and zooming

flutter_k_chart 介绍 一个仿火币的flutter图表库包含深度图,支持各种指标及放大缩小、平移等操作 webdemo演示 Demo v0.1.0:下载 APK 演示 简单用例 1.在 pubspec.yaml 中添加依赖 本项目数据来自火币openApi,火币的接口可能需要翻墙,接口

gwh 259 Dec 30, 2022
:bar_chart: [wip] Create beautiful, responsive, animated charts using a simple and intuitive API.

fcharts 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 pr

Keenan Thompson 323 Dec 21, 2022
Charts Library for Flutter, written in Dart with Flutter.

Table of Contents New in the current release Illustration of the new "iterative auto layout" feature Autolayout step 1 Autolayout step 2 Autolayout st

Milan Zimmermann 225 Dec 25, 2022
Beautiful sparkline charts for Flutter

flutter_sparkline Beautiful sparkline charts for Flutter. Installation Install the latest version from pub. Quick Start Import the package, create a S

Victor Choueiri 255 Dec 21, 2022
A library to draw fantastic bar charts race in Flutter

bar_chart_race The first library to draw fantastic bar charts race in Flutter Usage Let's get started add the dependencies to your app: dependencies:

Mimene Younes 6 Jun 24, 2022
A flutter package which makes it easier to plot different types of charts with lots of customization, made purely in dart

multi_charts It is a library that provides different types of charts to plot data points. Currently it supports only Radar Chart, but will support mor

Intkhab Ahmed 28 Nov 9, 2022
Flutter package for creating simple yet modern looking charts

A package for creating simple yet modern looking charts. Five chart types Bar Gauge Line Pie Radar Canvas + DOM modern_charts combines Canvas and DOM

Man Hoang 68 Nov 4, 2022
Flutter Cryptocurrency Charts application based on Clean Architecture.

About the project The purpose of this project is to develop the best Cryptocurrency, markets data and charts experience. This project has been built u

null 25 Jan 1, 2023
Charts [2148⭐] - By Google Team.

Charts is a general charting library, currently enabled for the Flutter mobile UI framework. See the online gallery for supported chart types and exam

Google 2.8k Dec 31, 2022
In this project you will see how to generate charts with the data from the Firestore.

FlutterChartFirestore Flutter Tutorial - Flutter Charts+Firestore Video series can be watched here https://youtu.be/HGkbPrTSndM Getting Started In thi

Whatsupcoders 49 Oct 21, 2022
kg_charts icon library. At present, there are only radar charts

kg_charts icon library. At present, there are only radar charts. Other types of charts may be added later

zhonghua 10 Oct 25, 2022
A powerful Flutter chart library, currently supporting Line Chart, Bar Chart, Pie Chart, Scatter Chart and Radar Chart.

FL Chart ?? A library to draw fantastic charts in Flutter ?? Chart Types LineChart BarChart PieChart Read More Read More Read More ScatterChart RadarC

Iman khoshabi 5.2k Dec 27, 2022
A beautiful bezier line chart widget for flutter that is highly interactive and configurable.

Bezier Chart A beautiful bezier line chart widget for flutter that is highly interactive and configurable. Features Multi bezier lines Allow numbers a

Aeyrium 428 Dec 21, 2022
[reborned barcode_scan] A flutter plugin for reading 2D barcodes and QR codes.

Reborned ?? Original barcode_scan was discontinued, so barcode_scan2 was borned with sound null safety support ?? barcode_scan2 A flutter plugin for s

Masayuki Ono (mono) 61 Jan 6, 2023
This project is used to introduce the use of flutter canvas, include draw chart, clip image's path and draw progress indicator.

flutter_canvas This project is used to introduce the use of flutter canvas, include draw chart, clip image's path and draw progress indicator. draw ch

YouXianMing 9 Oct 27, 2022
Maybe this is the best k chart in Flutter.Support drag,scale,long press,fling.And easy to use.

k_chart Maybe this is the best k chart in Flutter.Support drag,scale,long press,fling.And easy to use. display image gif Getting Started Install depen

OpenFlutter 342 Jan 9, 2023