Echarts?
About Echarts please go here
Force Guide Diagram
Implementation methods, such as:
function require_EC () {require( [ 'echarts', //载入force模块 'echarts/chart/kforce' ], function (ec) { //确定需要绘制的DOM setChats(ec); })}function setChats (ec) {var myChart = ec.init(document.getElementById('main'));myChart.setOption(option);}
Data source Description
The main three data sources: categories (data classification), nodes (node name in the chart), links (link lines between nodes in the chart), as follows:
API Development
Force Guide Diagram Data API documentation (personal comments for reference only)
Implementation features |
1, categories, nodes, links, array on-demand load, reduce server pressure; 2, the optimization of the Display Island link 3. Cache Data Application |
Main parameters and primary values for interface delivery |
Name, force, categories, nodes, links, cache, refresh |
Return code |
See Return code attachment diagram |
Parameter description:
Request Example: (see picture for details)
Example links |
return value |
Meaning |
Force-api.php?name=demo1&force=nodes |
Picture Details |
Gets the nodes (node) data for a force-directed chart called "Demo1" |
Force-api.php?name=demo1&force=categories |
Picture Details |
Obtained the categories (categorical) data of a force-directed chart called "Demo1", "and so on links do not make an example" |
Force-api.php?name=demo1_isolated_all&force=links |
Picture Details |
"How do I get an island link?" "Make a diagram of an island link a new chart: Get the links array for all of Demo1 's Island links (Demo1_isolated_all) |
Force-api.php?name=demo1_isolated_all&force=nodes&cache=refresh |
Picture Details |
Gets the node array of all islanding links (Demo1_isolated_all) of Demo1 and makes a forced flush |
Note: The first time the server is requested, the correct return code if requested will be
code: "2200",message: "nodes success",
The second request server will return
code: "3304",message: "cache:2015-01-19 15:14:43",
Unless you add the parameter cache=refresh
cache time 3 days
Return Code conventions
Finish
Attached this API interface source PHP (PHP casually write down, tap ... ): Download
The above introduces the force-oriented layout of echarts-Data source description and backend API conventions, including the contents of the content, I hope that the PHP tutorial interested in a friend helpful.