Giter Site home page Giter Site logo

flutter_k_chart's Introduction

flutter_k_chart

License

介绍

一个仿火币的flutter图表库包含深度图,支持各种指标及放大缩小、平移等操作

webdemo演示 Demo v0.1.0:下载 APK

演示

chart_imge depth_image image1

简单用例

1.在 pubspec.yaml 中添加依赖

本项目数据来自火币openApi,火币的接口可能需要翻墙,接口失败后会加载本地json。由于项目没有很好的封装,建议使用本地方式使用

//本地导入方式
dependencies:
  flutter_k_chart:
    path: 项目路径

2.在布局文件中添加

import 'package:flutter_k_chart/flutter_k_chart.dart';
....
Container(
  height: 450,
  width: double.infinity,
  child: KChartWidget(
    datas,//数据
    isLine: isLine,//是否显示折线图
    mainState: _mainState,//控制主视图指标线
    secondaryState: _secondaryState,//控制副视图指标线
    volState: VolState.VOL,//控制成交量指标线
    fractionDigits: 4,//保留小数位数
  ),
 )
 
 //深度图使用
 Container(
   height: 230,
   width: double.infinity,
   child: DepthChart(_bids, _asks),
 )         

3.修改样式

可在chart_style.dart里面修改图表样式

4.数据处理

//接口获取数据后,计算数据
DataUtil.calculate(datas);
//更新最后一条数据
DataUtil.updateLastData(datas);
//添加数据
DataUtil.addLastData(datas,kLineEntity);

国际化 l10n

import 'package:flutter_k_chart/generated/l10n.dart' as k_chart;
MaterialApp(
      localizationsDelegates: [
        k_chart.S.delegate//国际化
      ],
);

问题

使用中如果有问题可以加QQ群:114563912

请咖啡☕️

🙏感谢🙏

微信

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.