GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PandaYuen/KDemo: Android开发专业k线图表组件,支持JDK,MACD,MA,VOL等指标,后续指标陆续更新

BranchesTags
Open more actions menu
 
 

Latest commit

 

History

39 Commits
39 Commits

Folders and files

NameName
Last commit message
Last commit date
.idea
.idea
 
 
app
app
 
 
gradle/wrapper
gradle/wrapper
 
 
klinelibrary
klinelibrary
 
 
photo
photo
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.gradle
build.gradle
 
 
gradle.properties
gradle.properties
 
 
gradlew
gradlew
 
 
gradlew.bat
gradlew.bat
 
 
settings.gradle
settings.gradle
 
 

Repository files navigation

KDemo

专业k线图表组件,支持JDK,MACD,MA,VOL等指标,后续指标陆续更新

image

android studio开发工具中: 第一步:在工程build.gradle中添加如下代码

allprojects { repositories { ... maven { url "https://jitpack.io" } } } 第二步:在dependency,添加如下代码

dependencies { compile 'com.github.zhangliangzs:KDemo:1.0.0' }

项目应用: 在布局文件中添加组件: <zhangliang.view.android.klibrary.view.KView android:id="@+id/kview" android:layout_width="match_parent" android:layout_height="match_parent" />

activity中找到控件: KView mMyChartsView = (KView) findViewById(R.id.kview);

最主要的是数据的显示,数据mode的封装,主要封装在MarketChartData中:结构如下:

public class MarketChartData { long time = 0; double openPrice = 0; double closePrice = 0; double lowPrice = 0; double highPrice = 0; double vol = 0;

public MarketChartData() {

}

public long getTime() {
    return time;
}

public String getTime2() {
    SimpleDateFormat sdf = new SimpleDateFormat("HH:mm");
    return sdf.format(time*1000);
}
public String getTime3() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    return sdf.format(time*1000);
}
public String getTime4() {
    SimpleDateFormat sdf = new SimpleDateFormat("MM-dd");
    return sdf.format(time*1000);
}
public void setTime(long time) {
    this.time = time;
}

public double getOpenPrice() {
    return openPrice;
}

public void setOpenPrice(double openPrice) {
    this.openPrice = openPrice;
}

public double getClosePrice() {
    return closePrice;
}

public void setClosePrice(double closePrice) {
    this.closePrice = closePrice;
}

public double getLowPrice() {
    return lowPrice;
}

public void setLowPrice(double lowPrice) {
    this.lowPrice = lowPrice;
}

public double getHighPrice() {
    return highPrice;
}

public void setHighPrice(double highPrice) {
    this.highPrice = highPrice;
}

public double getVol() {
    return vol;
}

public void setVol(double vol) {
    this.vol = vol;
}

}

new 个数组装载model数据: private List marketChartDataLists = new ArrayList(); 你的activity界面请求json数据,封装在这个模型中,在代码中添加

  mMyChartsView.setOHLCData(marketChartDataLists);
  mMyChartsView.postInvalidate();

  就能将图表数据显示出来


  主要方法:
        mMyChartsView.setClose();//关闭指标
        mMyChartsView.setMACDShow();//显示macd
        mMyChartsView.setKDJShow();//显示kdj

如果有疑问请加QQ:1179980507,一起完善和做好这个控件

IOS版地址: https://github.com/zhiquan911/CHKLineChart

效果如下图: image

About

Android开发专业k线图表组件,支持JDK,MACD,MA,VOL等指标,后续指标陆续更新

Resources

Readme
Activity

Stars

0 stars

Watchers

1 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.