搜索插件、代码仓与 APP 分类

插件详情v0.1.4

flutter_candlesticks

适用于 Flutter 的优雅 OHLC K 线和交易量图表。

近 30 天下载
56
喜欢数
30
Pub 分数
40

安装插件

flutter pub add flutter_candlesticks

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

一个用于创建优雅的OHLC(开盘价、最高价、最低价、收盘价)K线图和交易量可视化的Flutter包。专为金融数据展示设计,提供流畅且可定制的图表渲染,并支持实时更新。该包可无缝集成到Flutter应用中,提供简洁的API来绘制价格走势和交易活动。非常适合需要专业级绘图功能的加密货币、股票或外汇跟踪应用。

适合场景

  • 金融市场数据可视化
  • 加密货币价格追踪
  • 股票和外汇图表
  • 实时交易仪表板
  • 投资组合绩效监控

主要特点

  • OHLC K线图渲染
  • 交易量可视化
  • 流畅的动画
  • 可自定义的颜色和样式
  • 响应式设计
  • 与数据流的轻松集成

适合对象

  • 交易应用开发者
  • 财务数据分析师
  • 加密货币仪表板创建者
  • 实时图表应用
  • 面向用户的金融工具

使用建议

  • 仅限二维图表类型
  • 无内置数据获取
  • 需要手动处理时间序列数据
  • 未针对非常大的数据集进行优化
  • 依赖外部数据源以获取实时更新

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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
            ),
          ),
        ),
      )
    )
  );
}

所属分类

源码仓库

使用此插件的项目