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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
|
Supplementary knowledge: echarts chart size changes adaptively as the window changes (No need to refresh the browser to adjust)
Question:
After using echars to make charts, you need to make adaptive effects according to the zoom of the browser window.
Cause analysis and solution:
The icon instance of echars does not actually actively bind the resize() event , which means that the size change of the display area is not known internally. When you need to do some adaptive effects, you need to actively bind this time to achieve the effect of self-use. Common ones are window.onresize = myChart.resize( )
Example:
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 30 31 32 33 34 |
|
Key points:
1 2 3 |
|
Recommended tutorial:《 JS tutorial》
The above is the detailed content of Implement Echarts in Vue to change with the form. For more information, please follow other related articles on the PHP Chinese website!