echarts 官网
https://echarts.apache.org/examples/zh/index.html#chart-type-line
以下示例显示


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
| <p id="test" style="width: 234px;height:230px;"></p> <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script> <script src="https://cdn.bootcdn.net/ajax/libs/echarts/5.5.0/echarts.common.js"></script> <script> createTorusEcharts('test'); function createTorusEcharts(row){ const chartInstance = echarts.init(document.getElementById(row)); const option = { color: ['#0086e5', '#c5c5c52e'], series: [ { type: 'pie', radius: ['60%', '75%'], avoidLabelOverlap: false, label: { show: false, position: 'center', }, emphasis: { label: { show: false, fontSize: '20', fontWeight: 'bold' } }, data: [123,342] } ], graphic: [{ type: 'text', left: 'center', top: 'center', style: { text: "80%", textAlign: 'center', fill: '#333', fontSize: 8 } }] }; chartInstance.setOption(option); } </script>
|