Bar chart based on ets with backend integration and vertical table scrolling (Original Work)
Add-ons

Plugin Description: The bar chart is based on ets. The automatic scrolling method for the table has been commented, allowing you to modify the scrolling speed and specify the minimum number of rows before scrolling starts.
Last Updated: 2020-02-29 23:31:48
Usage
This is my own API key (ak). You can replace it with yours.
1 | <script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=0xdI6Lq0agqBHUtthykRldY7gMTM378p"></script> |
These two echarts themes are optional.
1 2 3 | <!-- Import theme --> <script src="js/chalk.js"></script><script src="js/purple-passion.js"></script> |
This is the bar chart's automatic tooltip display. I set the interval to 3 seconds.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | var app = { currentIndex: -1,};setInterval(function() { var dataLen = option.series[0].data.length; // Cancel highlighting of the previously highlighted graphic myChart.dispatchAction({ type: 'downplay', seriesIndex: 0, dataIndex: app.currentIndex }); app.currentIndex = (app.currentIndex + 1) % dataLen; //console.log(app.currentIndex); // Highlight the current graphic myChart.dispatchAction({ type: 'highlight', seriesIndex: 0, dataIndex: app.currentIndex, }); // Display tooltip myChart.dispatchAction({ type: 'showTip', seriesIndex: 0, dataIndex: app.currentIndex });}, 3000);// Table scrolling method// Parameter 1: tableID; Parameter 2: div height; Parameter 3: speed; Parameter 4: minimum number of tr elements in tbody before scrollingtableScroll('tableId', 200, 60, 5) |
评论