Skip to content

Aressssssssssssss/k_chart_multiple

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k_chart_multiple

Maybe this is the best k chart in Flutter.Support drag,scale,long press,fling.And easy to use. Based on the https://github.com/OpenFlutter/k_chart_multiple Added support for multiple secondary chart and hiding main chart

display

image

Screenshot

Screenshot

Screenshot

gif

demo

demo

Getting Started

Install

dependencies:
  k_chart_multiple: ^1.0.0

or use latest:

k_chart_multiple:
    git:
      url: https://github.com/mafanwei/k_chart_multiple

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
                secondaryStates: _secondaryStates,// Decide what the sub views 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
                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.
                isTrendLine: false, // You can use Trendline by long-pressing and moving your finger after setting true to isTrendLine property. 
                xFrontPadding: 100 // padding in front
              ),
            ),

use depth chart:

DepthChart(_bids, _asks, chartColors) //Note: Datas must be an ordered list,

Thanks

gwhcn/flutter_k_chart

About

Maybe it is the best k chart in Flutter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 84.5%
  • C++ 7.4%
  • CMake 6.6%
  • HTML 0.6%
  • C 0.5%
  • Swift 0.4%