All Projects → VinsonGuo → Android Kline

VinsonGuo / Android Kline

Licence: apache-2.0
Android版K线图和分时图

Programming Languages

java
68154 projects - #9 most used programming language

Labels

Projects that are alternatives of or similar to Android Kline

Hqchart
HQChart - H5, 微信小程序 沪深/港股/数字货币/期货/美股 K线图(kline),走势图,缩放,拖拽,十字光标,画图工具,截图,筹码图. 分析家语法,通达信语法,(麦语法),第3方数据替换接口
Stars: ✭ 1,126 (+88.61%)
Mutual labels:  kline
PrincekinKlineFrame
一款用Swift开发的K线图和深度图组件,具有轻量、敏捷等特点,可供虚拟货币行业和金融行业使用
Stars: ✭ 72 (-87.94%)
Mutual labels:  kline
DepthChart
深度图
Stars: ✭ 28 (-95.31%)
Mutual labels:  kline
Vue Kline
基于Vue的K线图组件. A K line library written in vue.js.
Stars: ✭ 111 (-81.41%)
Mutual labels:  kline
binance-downloader
Python tool to download Binance Candlestick (k-line) data from REST API
Stars: ✭ 44 (-92.63%)
Mutual labels:  kline
StockView
股票相关控件(分时图、五日分时图、自选股迷你分时图、资金趋势图、盈亏额/盈亏率)- (曲线图、折线图)
Stars: ✭ 87 (-85.43%)
Mutual labels:  kline
Kchartview
KChart for Android ;股票k线图
Stars: ✭ 864 (+44.72%)
Mutual labels:  kline
Okklineswift
Draw the K-Line by Swift, support iOS & macOS
Stars: ✭ 406 (-31.99%)
Mutual labels:  kline
OKKLineMin
OKKLineMin kline for min for learning for iPhone (support Swift5 & the latest Swift & iPhone & iOS 16)(min K线图 用于学习了解)
Stars: ✭ 23 (-96.15%)
Mutual labels:  kline
StockChart
StockChart是一款适用于Android的高扩展性、高性能股票图开发库,轻松完成各种子图的组合,还能灵活的定制自己的子图满足复杂的业务需求。
Stars: ✭ 62 (-89.61%)
Mutual labels:  kline
Yykline
iOS YYKline:Kline、Chart、Volume、Scroll、Scale、MACD、KDJ、K线图、分时图...
Stars: ✭ 2,318 (+288.27%)
Mutual labels:  kline
Klineview
Android股票走势图K线控件
Stars: ✭ 224 (-62.48%)
Mutual labels:  kline
k-line
股票、虚拟币交易k线图
Stars: ✭ 32 (-94.64%)
Mutual labels:  kline
Flutter Candlesticks
Flutter candlesticks package
Stars: ✭ 88 (-85.26%)
Mutual labels:  kline
Klinechart
📈Lightweight k-line chart that can be highly customized. Zero dependencies. Support mobile.(可高度自定义的轻量级k线图,无第三方依赖,支持移动端)
Stars: ✭ 303 (-49.25%)
Mutual labels:  kline
Kschart
k线图/kline/kchart,已经集成MA/EMA/MACD/KDJ/BOLL/RSI/WR/AVG等指标,新增指标及其方便。适用于股票/区块链交易所等种类App。Swift5编写,CPU/内存占用率极低,60FPS稳定运行。示例集成websocket,并接入币安数据(需VPN)。
Stars: ✭ 909 (+52.26%)
Mutual labels:  kline
KLineChartAndroid
A kline chart UI widget for android(Android版本的k线).
Stars: ✭ 51 (-91.46%)
Mutual labels:  kline
Chklinechart
纯Swift4.0代码编写的K线图表组件,支持:MA,EMA,BOLL,SAR,KDJ,MACD等技术指标显示。集成使用简单,二次开发扩展强大
Stars: ✭ 409 (-31.49%)
Mutual labels:  kline
Hycharts
柱状图、折/曲线图、K线图(主图、交易量图、辅助图), 图与图可以自由组合, 支持分页加载数据 -----> 低内存、低耗电、滑动缩放顺滑
Stars: ✭ 394 (-34%)
Mutual labels:  kline
QT StockFigure
QT显示股票分时线
Stars: ✭ 16 (-97.32%)
Mutual labels:  kline

android-kline

基于MPAndroidChart的K线图

简介

android-kline是Android平台的金融图表库,包括分时图K线图。本项目通过继承的方式定制了最新版本的MPAndroidChart,解决了下面的问题:

  • 解决了多图表手势同步的问题
  • 解决多图表highlight联动的问题
  • 使用简单,两行代码就可以实现专业K线效果

Demo

demo

也可以点击这里下载

配置

在项目build.gradle中添加依赖:

 allprojects {
        repositories {
            jcenter()
            maven { url "https://jitpack.io" }
        }
   }
   dependencies {
        compile 'com.github.VinsonGuo:android-kline:2.0.0-alpha'
   }

快速开始

mTimeLineView = new TimeLineView(getContext());  //初始化分时图
mTimeLineView.setDateFormat("HH:mm");  // 设置x轴时间的格式
List<HisData> hisData =  ...  // 初始化数据,一般通过网络获取数据
mTimeLineView.setLastClose(hisData.get(0).getClose());  // 设置昨收价
mTimeLineView.initData(hisData);  // 初始化图表数据

xml

    <com.vinsonguo.klinelib.chart.KLineView
        android:id="@+id/kline"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <com.vinsonguo.klinelib.chart.TimeLineView
        android:id="@+id/timeline"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>

java

       KLineView  K线图控件
       public void showKdj() 显示kdj指标
       public void showMacd() 显示macd指标
       public void showVolume() 显示交易量指标
       public void initData(List<HisData> hisDatas) 初始化数据,获取到数据后调用
       public void addData(HisData hisData) 图表末尾增加一个数据
       public void refreshData(float price) 刷新最后一个点的价格(不增加数据)
       
       
       TimeLineView 分时图控件
       public void initData(List<HisData> hisDatas) 初始化数据,获取到数据后调用
       public void addData(HisData hisData) 图表末尾增加一个数据
       public void refreshData(float price) 刷新最后一个点的价格(不增加数据)
       public void initDatas(List<HisData>... hisDatas) 初始化多日的数据,比如说5日的数据,就传5个list过去
       public void setLastClose(double lastClose)  设置昨天的收盘价,用于计算涨跌幅的坐标
       
       两个类共同的api:
       public void setCount(int init, int max, int min) 设置图标的可见个数,分别是初始值,最大值,最小值。比如(100,300,50)就是开始的时候100个点,最小可以缩放到300个点,最大可以放大到50个点
       public void setDateFormat(String format) 设置x轴时间的格式
       public void setLastClose(douhle lastClose) 设置昨收价格,用于计算涨跌幅
       

注意: 这里需要接收一个HisData的List,HisData需要如下的几个数据(开盘、收盘、最高、最低、买卖量、时间),其他的指标会根据公式计算出来

在本项目中,时间戳date相当于唯一的id,如果重复的话无法将这个date添加到图表中

  public HisData(double open, double close, double high, double low,  long vol, long date)

个性化:如果需要配置颜色,可以到colors.xml中重写颜色的值。

联系方式

qq群: 494309361

License

Copyright VinsonGuo

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].