ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Cross-platform stock chart library based on the canvas - clchart

2020-04-29 18:51:15  阅读:276  来源: 互联网

标签:canvas based use chart libraries ClChart data drawing


 What is ClChart

ClChart is a simple, high-performance and cross-platform open source project for stock data visualization created based on the canvas. Support PC, webApp and React Native and Weex platforms. Fully adapting the open source project GCanvas on React Native and Weex makes it easy to use GCanvas to enable your developed applications to have native drawing capabilities on android and ios.

 Why do you need ClChart

In the existing open source libraries, there are no shortage of very good open source chart libraries. The general chart libraries include chartjs,echart,highchart, etc. These chart libraries have very complete chart types and powerful drawing capabilities and speeds, but due to the need of these items There is generality, and we need to expand when we draw the trading document. The specific chart libraries for stocks such as stocks are: techanjs and highcharts/highstock . These charting libraries have done some very professional processing and optimization of the stock drawing, but they are all based on svgdrawing. We have performance issues when drawing large numbers of data graphs and dealing with cross-platforms.

The following is a comparison of the K-charts drawn by the stocks of each gallery in the use process.
The following comparisons are based on the use of these charting libraries to draw comparisons of the mapping capabilities of the securities of the securities type, and the data subjective experience determination.

|   | chartjs | echart | techanjs | highchart | clchart |
| --- | --- | --- | --- | --- | --- |
| Drawing element |canvas| canvas & svg| svg | svg | canvas |
| Easy to use | ☆☆☆☆☆ | ☆☆☆ | ☆☆☆☆  | ☆☆☆☆ | ☆☆☆☆☆ |
| Drawing speed | ☆☆☆☆☆ | ☆☆☆ | ☆☆ | ☆☆ | ☆☆☆☆☆ |
| Expanding ability | ☆☆☆ | ☆☆☆☆ | ☆☆☆☆ | ☆☆☆☆ | ☆☆☆☆☆ |
| Cross-platform | ☆☆☆ | ☆☆☆ | ☆☆ | ☆ | ☆☆☆☆☆ |

Therefore, we urgently need an icon library with high-performance, cross-platform, and easy-to-use stock types.

In the existing icon library React Native, you can load html files via webview, use window.document.addEventListener('message', function(e) {})and window.postMessageto complete the html and React Natve communication drawing, but use the actual use process, in some poor performance android devices, especially android Android systems with versions lower than 4.4 perform particularly badly when plotting large data volume graphs and user interactions. Caton often occurs, and there may be issues such as slow loading.

 ClChart design goals

The use of canvasdevelopment has a highly efficient , cross-platform of professional stock charting library 

Having compatible GCanvas provided canvasinterface, in React Native and Weex reach native drawing on, and able to live horizontally extended for more stock market equation system in the form of plug-ins, for users with special needs, it is possible to provide custom Plug-in and data structure capabilities.

 ClChart development and implementation

 Build development environment

* [x] Using eslint to implement code specification
* [x] Using webpack for code packaging
* [x] Write an example demo
* [ ] Use karma and mocha to write code tests (in progress...)

 Double-layer canvas, separation of primary and secondary layers, efficient drawing

When studying the drawing program of tradingview , we found that in order to quickly redraw the auxiliary lines such as crosshairs, the use of double-layered canvasseparation crosshairs (such as auxiliary lines) and the drawing of the main layer greatly reduces the time needed to quickly move the crosshairs. The extra drawing calculations come. Enables androida smooth user experience on low-end mobile devices and web apps

 Scalable data layer

ClChartImplementation of an independent data layer, which can preprocess the data, cache functions, data FIELDdefinition and read through the field , the user can easily customize the data field to quickly integrate with the existing data.

 Custom formula system

ClChartSupports custom formula systems. Both developers and users can customize formulas for drawing during use.

 Plugin

ClChartSupports custom drawing plug-ins, now has plug-in data tag types

 Screenshot

pc

web

mina

reactnative

 ClChart project address, documentation, and test cases

github

中文文档

English docs

HTML5 Demo Can open experience on mobile phone and PC separately

React Native Demo

标签:canvas,based,use,chart,libraries,ClChart,data,drawing
来源: https://www.cnblogs.com/baimeishaoxia/p/12803999.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有