#Introduce We forked the project from https://github.com/OpenFlutter/k_chart and add some function to meet our requirments.
all the version below are the version we released.
0.5.1
- added the function that will show buy sell signal on the charts
0.5.2
- support set scale-x from parameter when build widget.it solve the problem that on the flutter web,the gesture scale not work.
0.5.3
- support extra line draw on the charts
0.5.4
- support extra text label draw on the charts
0.5.5
- support text scale parameter in text label
0.5.6
- support line stroke width parameter
how to publish:
https://dart.cn/tools/pub/publishing
- pubspec.yaml modify
- CHANGELOG.md modify
- run command:
- dart pub publish --dry-run
- dart pub publish
Raw README.md from forked project
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
dependencies:
k_chart: ^0.5.0
or use latest:
k_chart:
git:
url: https://github.com/mafanwei/k_chart
Usage
When you change the data, you must call this:
DataUtil.calculate(datas); //This function has some optional parameters: n is BOLL N-day closing price. k is BOLL param.
use k line chart:
Container(
height: 450,
width: double.infinity,
child: KChartWidget(
chartStyle, // Required for styling purposes
chartColors,// Required for styling purposes
datas,// Required,Data must be an ordered list,(history=>now)
isLine: isLine,// Decide whether it is k-line or time-sharing
mainState: _mainState,// Decide what the main view shows
secondaryState: _secondaryState,// Decide what the sub view shows
fixedLength: 2,// Displayed decimal precision
timeFormat: TimeFormat.YEAR_MONTH_DAY,
onLoadMore: (bool a) {},// Called when the data scrolls to the end. When a is true, it means the user is pulled to the end of the right side of the data. When a
// is false, it means the user is pulled to the end of the left side of the data.
maDayList: [5,10,20],// Display of MA,This parameter must be equal to DataUtil.calculate‘s maDayList
bgColor: [Colors.black, Colors.black],// The background color of the chart is gradient
translations: kChartTranslations,// Graphic language
volHidden: false,// hide volume
showNowPrice: true,// show now price
isOnDrag: (isDrag){},// true is on Drag.Don't load data while Draging.
onSecondaryTap:(){}// on secondary rect taped.
),
),
use TrendLine(New): You can use Trendline by long-pressing and moving your finger after setting true to isTrendLine property.
use depth chart:
DepthChart(_bids, _asks, chartColors) //Note: Datas must be an ordered list,
Donate
Buy a cup of coffee for the author.
Thanks
Other
Maybe there are some bugs in this k chart,or you want new indicators,you can create a pull request.I will happy to accept it and I hope we can make it better.
The version of fork
Libraries
- renderer/base_chart_painter
- renderer/base_chart_renderer
- entity/candle_entity
- entity/cci_entity
- renderer/chart_painter
- chart_style
- chart_translations
- utils/data_util
- utils/date_format_util
- depth_chart
- entity/depth_entity
- entity/extra_buy_sell_signal
- entity/extra_line
- entity/extra_text_label
- flutter_k_chart
- renderer/index
- entity/index
- utils/index
- entity/info_window_entity
- k_chart_widget
- entity/k_entity
- entity/k_line_entity
- entity/kdj_entity
- entity/macd_entity
- renderer/main_renderer
- extension/map_ext
- extension/num_ext
- utils/number_util
- entity/rsi_entity
- entity/rw_entity
- renderer/secondary_renderer
- renderer/vol_renderer
- entity/volume_entity