K chart widget in Flutter.
- Support gesture drag, scale, long press, fling.
- Support MA, BOLL for main chart.
- Support MACD, KDJ, RSI, WR, CCI for secondary chart.
dependencies:
quant_chart: ^0.0.1
// Init data.
DataUtil.calculate(data);
// Use k chart widget:
QuantChart(
data: data,
style: ChartStyle(),
isLine: true,
isTrendLine: false,
mainState: MainState.MA,
volHidden: false,
secondaryState: SecondaryState.MACD,
timeFormat: TimeFormat.YEAR_MONTH_DAY,
translations: {
'zh_CN': ChartTranslations(
date: '时间',
open: '开',
high: '高',
low: '低',
close: '收',
changeAmount: '涨跌额',
change: '涨跌幅',
amount: '成交额',
)
},
showNowPrice: true,
hideGrid: true,
isTapShowInfoDialog: true,
maDayList: const [1, 100, 1000],
dataFormat: (value) => value.toStringAsFixed(2)
)