仿中国比特币首页趋势图,折线图,k线图
2017-09-14 11:48
846 查看
LineChart
android line chart仿照中国比特币的首页行情趋势图 www.chbtc.com
Github Repository and Library
https://github.com/onlynight/LineChart使用
Step 1. Add the JitPack repository to your build fileAdd it in your root build.gradle at the end of repositories:
allprojects { repositories { ... maven { url 'https://jitpack.io' } } }
Step 2. Add the dependency
dependencies { compile 'com.github.onlynight:LineChart:1.0.0' }
Step 3. in your xml layout file
<com.github.onlynight.chart.LineChartView android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="200dp" app:axisXHasScaleText="true" app:axisXHasVerticalLine="true" app:axisXMaxScaleNum="4" app:axisXScalePosition="center" app:axisYHasScaleText="true" app:axisYHasVerticalLine="true" app:axisYMaxScaleNum="4" app:axisYScalePosition="center" app:axisYScaleTextSize="10sp" app:contentMargin="10dp" app:hasAxisX="true" app:hasAxisY="true" app:lineContentMargin="10dp"/>
Step 4. in your java controller file
mLineChartView = (LineChartView) findViewById(R.id.chart); initChartData(); private void initChartData() { Line line = new Line().setLineColor(Color.RED).setLineWidth(5).setCube(true); List<ChartPoint> chartPoints = new ArrayList<>(); Random random = new Random(); for (int i = 0; i < 100; i++) { ChartPoint cp = new ChartPoint(i, random.nextInt() * 100 % 5); cp.setValue(String.valueOf(i)); chartPoints.add(cp); } line.setData(chartPoints); mLineChartView.setLine(line); }
相关文章推荐
- 博客园出现在MSDN中国的首页链接
- 中国嵌入式应用市场四大热点及趋势
- 2017中国运营大会开启报名 | 国内知名互联网公司运营大咖齐聚首都 · 北京,解读未来运营的发展趋势
- 知识管理在中国的发展趋势
- 企服三会·PPT | 中国软件网曹开彬:洞见2018中国CRM趋势洞察报告
- 2016中国app年度排行榜:十大行业、25个领域、Top 500 和2017趋势预测
- 一探中国的比特币挖矿工厂
- 中国被爱可以在线WAP站点首页源代码
- 中国制造业发展环境及信息化趋势分析
- 中国ERP未来趋势
- 辟谣:中国无法通过控制矿工来控制比特币网络
- 比特币事件是否证明中国网络安全不堪一击?
- 中国嵌入式应用市场四大热点及趋势
- 蓝天碧水中国梦-风电(3)-中国风电发展的趋势和方向
- 中国DVR卡发展过程与趋势分析
- 说海尔想中国未来制造发展趋势
- 中国34个省未来发展趋势深度分析
- ngrok首页、文档和下载 - Web服务安全通道 - 开源中国社区
- 2013 百度站长交流会暨中国网站运营发展趋势报告发布会
- 中国和欧盟的40家公司申请在俄罗斯挖比特币