Baidu Ets Dynamic Data Addition
Add-ons

Plugin Description: Click different buttons to send ajax requests and populate Ets with data.
Note: This plugin must run in a server environment. Previewing it locally will cause cross-origin issues!
Usage
1. Include the required jQuery and echarts JavaScript files.
1 2 | <script src="js/jquery-1.11.1.min.js"></script><script src="js/echarts.js"></script> |
Note: The following are the main JavaScript files. If you do not want to include too many JavaScript files, you can also place the code directly in your own HTML page.
1 | <script src="js/echartsOne.js"></script> |
2. Add two buttons and one div in the HTML. The div is used to contain the charts.
1 2 3 4 5 | <h3> <button id="qxfl" data-index="1">First echarts</button> <button id="gfzr" data-index="2">Second echarts</button></h3><div id="main" style="width: 600px;height:400px;"></div> |
3. Call the methods in echartsOne.js on the page.
1 2 3 4 5 6 7 8 9 | <script type="text/javascript"> $(function() { // Initially display the first one qxfl('#qxfl'); $("h3 button").click(function() { qxfl(this); }) });</script> |
*** The requested data is echartsOne.json
评论