走势图、分时图、蜡烛图 FinancialCustomerView
scsfwgy 1天前 收藏
FinancialCustomerView
- 本项目会对金融交易软件中存在的各种View进行模仿绘制
- 提供详细的实现思路
- 收集整理相关算法、文档以及专业资料
- 开源实现的金融自定View,已经核对过指标算法数据
- 开源库已成功接入外汇、数字货币KView
实现思路及资料
算法以及Java版实现
- https://github.com/scsfwgy/FinancialCustomerView/tree/master/%E8%B5%84%E6%96%99%E4%B8%8E%E6%96%87%E6%A1%A3
- Java版实现:FinancialAlgorithm.java
Usage
Add the following to your project level build.gradle:
allprojects { repositories { jcenter() } }
Add this to your app build.gradle:
implementation 'com.wgyscsf:financialLib:0.0.1'
在布局文件中引入需要使用的自定义View(
wgyscsf.financiallib.view.fund.FundView
、wgyscsf.financiallib.view.kview.KView
)个性化设置,like this
/** * 定制,所有的画笔以及其它属性都已经暴露出来,有了更加大的定时灵活性。更多参数可以直接查看源码... */ //常规set、get... mFundView.getBrokenPaint().setColor(getResources().getColor(R.color.colorAccent));//设置折现颜色 mFundView.getInnerXPaint().setStrokeWidth(1);//设置内部x轴虚线的宽度,px mFundView.getBrokenPaint().setStrokeWidth(1); //链式调用 mFundView .setBasePaddingTop(140) .setBasePaddingLeft(50) .setBasePaddingRight(40) .setBasePaddingBottom(30) .setLoadingText("正在加载,马上就来...");
适配数据:需要将原始数据转换为本库需要的数据格式
- 加载数据进行显示
Demo
已成功模拟基金走势图、模拟K线走势、接入火币数字货币API(科学上网)、接入外汇API
效果图
基金收益折线图wgyscsf.financiallib.view.fund.FundView
KViewwgyscsf.financiallib.view.kview.KView
外汇类Demo
数字货币类Demo