123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192 |
- <template>
- <div>
- <div ref="echarts2" class="echarts2" style="height: 260px; width: 100%"></div>
- </div>
- </template>
- <style scoped></style>
- <script setup>
- import * as echarts from 'echarts'
- const echarts2 = ref()
- onMounted(() => {
- drawEcharts2()
- })
- function drawEcharts2() {
- var myChart2 = echarts.init(echarts2.value)
- var option2 = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- data: [
- {
- name: '省重点'
- },
- {
- name: '市重点'
- },
- {
- name: '完成率'
- }
- ],
- top: '0%',
- textStyle: {
- color: 'rgba(255,255,255,0.9)'
- }
- },
- xAxis: [
- {
- type: 'category',
- data: [
- '1月',
- '2月',
- '3月',
- '4月',
- '5月',
- '6月',
- '7月',
- '8月',
- '9月',
- '10月',
- '11月',
- '12月'
- ],
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- axisLabel: {
- textStyle: {
- color: 'rgba(255,255,255,.6)',
- fontSize: '14'
- }
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- name: '金额',
- min: 0,
- max: 50,
- interval: 10,
- axisLabel: {
- show: true
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.4)'
- }
- }
- },
- {
- type: 'value',
- name: '完成率',
- show: true,
- axisLabel: {
- show: true
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.4)'
- }
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#001e94'
- }
- }
- }
- ],
- grid: {
- top: '20%',
- right: '30',
- bottom: '30',
- left: '30'
- },
- series: [
- {
- name: '省重点',
- type: 'bar',
- data: [4, 6, 36, 6, 8, 6, 4, 6, 30, 6, 8, 12],
- barWidth: 'auto',
- itemStyle: {
- normal: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [
- {
- offset: 0,
- color: '#609db8'
- },
- {
- offset: 1,
- color: '#609db8'
- }
- ],
- globalCoord: false
- }
- }
- }
- },
- {
- name: '市重点',
- type: 'bar',
- data: [4, 2, 34, 6, 8, 6, 4, 2, 32, 6, 8, 18],
- barWidth: 'auto',
- itemStyle: {
- normal: {
- color: {
- type: 'linear',
- x: 0,
- y: 0,
- x2: 0,
- y2: 1,
- colorStops: [
- {
- offset: 0,
- color: '#66b8a7'
- },
- {
- offset: 1,
- color: '#66b8a7'
- }
- ],
- globalCoord: false
- }
- }
- },
- barGap: '0'
- },
- {
- name: '完成率',
- type: 'line',
- yAxisIndex: 1,
- data: [100, 50, 80, 30, 90, 40, 70, 33, 100, 40, 80, 20],
- lineStyle: {
- normal: {
- width: 2
- }
- },
- itemStyle: {
- normal: {
- color: '#cdba00'
- }
- },
- smooth: true
- }
- ]
- }
- myChart2.setOption(option2)
- }
- </script>
|