f_b_kline

Last updated:

0 purchases

f_b_kline Image
f_b_kline Images
Add to Cart

Description:

f b kline

使用 #
安卓原生K线
完整使用DEMO
持续更新中请尽量使用库依赖
DataAdapter不需要重新初始化 只需要一个adapter请做好内存管理

import 'package:f_b_kline/chart/export_k_chart.dart';

copied to clipboard

final DataAdapter adapter = DataAdapter();

......

retutrn Container(
margin: const EdgeInsets.only(top: 100),
width: double.maxFinite,
height: 400,
child: KChartWidget(
adapter,
config: KRunConfig(
dateFormatter: (int? value) {
return formatDate(
DateTime.fromMillisecondsSinceEpoch(value ?? 0));
},
mainValueFormatter: (number) {
return number?.toStringAsFixed(3) ?? '--';
},
volValueFormatter: (number) {
return number?.toStringAsFixed(3) ?? '--';
},
infoBuilder: (klineEntry) {
return <TextSpan, TextSpan>{
const TextSpan(text: 'Date'): TextSpan(
text: formatDate2(
DateTime.fromMillisecondsSinceEpoch(klineEntry.time ?? 0),
)),
const TextSpan(text: 'open'):
TextSpan(text: klineEntry.open.toStringAsFixed(3)),
const TextSpan(text: 'high'):
TextSpan(text: klineEntry.high.toStringAsFixed(3)),
const TextSpan(text: 'low'):
TextSpan(text: klineEntry.low.toStringAsFixed(3)),
const TextSpan(text: 'close'):
TextSpan(text: klineEntry.close.toStringAsFixed(3)),
const TextSpan(text: 'vol'):
TextSpan(text: klineEntry.vol.toStringAsFixed(3)),
};
},
),
),
),
)

......


adapter.resetData(data);
copied to clipboard
修改指数参数及配置信息 #
KStaticConfig 静态配置信息
copied to clipboard
...dart
...

KStaticConfig()
..mainMa1 = 10
..mainMa2 = 30
......


copied to clipboard
常用API #
///重置数据 当数据发生变化时调用
///[KLineEntity]数据模型
///更多API查看 [DataAdapter]
resetData(List<KLineEntity>? data, {bool resetTranslate = false})

copied to clipboard
///chart display type
/// [ChartGroupType] main display area
/// [ChartSenType] second type
/// [ChartDisplayType] time/kline
/// [MainDisplayType] boll / ma /none
changeType(dynamic type)
copied to clipboard
/// change chart display location
changeTranslate(double translate)
copied to clipboard

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.