Ichartjs is a homemade chart library that offers a variety of APIs, as well as a variety of style charts
Charts include: Area chart, 2d bar chart, 2d histogram, 3d histogram, line chart, pie chart, etc., and you can combine graphics.
Ichart is a lightweight JS component that quickly builds charts and can be used across platforms
This is the case of Ichart, on this page we view the method of invoking the API on the current chart by clicking on View Code
Reference documents used by the Ichart website API instructions
A simple example to familiarize yourself with ichart.js
1. Through the official website we go to download a latest version of Ichart (article at the end of the link)
2. In the root directory of the decompression we can see a ichart.1.2.min.js, this is the entire code of Ichart (with the. Min is a compressed version)
3. Create a folder and put the Ichart.1.2.min.js in the JS folder
4. Create a new HTML document to introduce jquery and ichart.1.2.min.js between
5. Create a div on the page and specify a id= ' Canvasdiv '
6. Enter the following code (with <script> included), a perfect 2d bar chart is done. !!
1 functionbar2d () {2 vardata = [3{name: ' Kamile jureviciute ', value:80, color: ' #006CFF '},{name: ' Donald Sue ', value:33, color: ' #FF6600 '},{name: ' Conni E Vuong ', value:173, color: ' #34A038 '},{name: ' Karen zanger ', value:75, color: ' #945D59 '}, ];4 5 Newichart.bar2d ({6Render: ' Canvasdiv ',//Specify the ID to draw to7 Data:data,//Chart data8Title: "Number of Patient Visit",//title of the chart9Animationtrue,//Whether to show animation, default to FalseTenDecimalsnum:2,//percent accurate to 2 bits Onewidth:900,//Width Aheight:400,//Height -Align: ' left ',//alignment, default to center -Padding:15,//Fill theborder: ' None ',//Border, default to True
Tip Tips for mouse interaction - tip:{ -Enabletrue, - listeners:{ + //Tip : Cue box object, Name: Data name, Value: Data value, Text: Current text, I: Index of data point -ParseText:function(tip,name,value,text,i) { + return"More information: <br/>" +value+ "K"; A } at } - }, - - - }). Draw (); - } in -Bar2d ();
7. Description
You can find the corresponding single chart JS in the extracted folder SRC, which only needs to load the JS component of the chart used (the Minify folder is a compressed version)
You can consult the documentation for more APIs
Ichart official website
(Note: Reprint please indicate source)
Introduce one! Very simple very convenient! JS Library for making chart report--ichartjs "detailed operation"