123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189 |
- <template>
- <div>
- <div ref="echarts4" class="echarts4"></div>
- </div>
- </template>
- <style scoped>
- .echarts4 {
- height: 242px;
- width: 100%;
- }
- </style>
- <script setup>
- import * as echarts from 'echarts'
- const echarts4 = ref()
- onMounted(() => {
- drawEcharts4()
- })
- function drawEcharts4() {
- var myChart4 = echarts.init(echarts4.value)
- var option4 = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- lineStyle: {
- color: '#57617B'
- }
- }
- },
- legend: {
- data: ['销售额', '利润'],
- top: '0',
- textStyle: {
- color: '#fff'
- },
- itemGap: 20
- },
- grid: {
- left: '0',
- right: '20',
- top: '10',
- bottom: '20',
- containLabel: true
- },
- xAxis: [
- {
- type: 'category',
- boundaryGap: false,
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- data: [
- '1月',
- '2月',
- '3月',
- '4月',
- '5月',
- '6月',
- '7月',
- '8月',
- '9月',
- '10月',
- '11月',
- '12月'
- ]
- },
- {}
- ],
- yAxis: [
- {
- axisLabel: {
- show: true,
- textStyle: {
- color: 'rgba(255,255,255,.6)'
- }
- },
- axisLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- },
- splitLine: {
- lineStyle: {
- color: 'rgba(255,255,255,.1)'
- }
- }
- }
- ],
- series: [
- {
- name: '销售额',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1,
- [
- {
- offset: 0,
- color: 'rgba(24, 163, 64, 0.3)'
- },
- {
- offset: 0.8,
- color: 'rgba(24, 163, 64, 0)'
- }
- ],
- false
- ),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#cdba00',
- borderColor: 'rgba(137,189,2,0.27)',
- borderWidth: 12
- }
- },
- data: [220, 182, 191, 134, 150, 120, 110, 125, 145, 122, 165, 122]
- },
- {
- name: '利润',
- type: 'line',
- smooth: true,
- symbol: 'circle',
- symbolSize: 5,
- showSymbol: false,
- lineStyle: {
- normal: {
- width: 2
- }
- },
- areaStyle: {
- normal: {
- color: new echarts.graphic.LinearGradient(
- 0,
- 0,
- 0,
- 1,
- [
- {
- offset: 0,
- color: 'rgba(39, 122,206, 0.3)'
- },
- {
- offset: 0.8,
- color: 'rgba(39, 122,206, 0)'
- }
- ],
- false
- ),
- shadowColor: 'rgba(0, 0, 0, 0.1)',
- shadowBlur: 10
- }
- },
- itemStyle: {
- normal: {
- color: '#277ace',
- borderColor: 'rgba(0,136,212,0.2)',
- borderWidth: 12
- }
- },
- data: [120, 110, 125, 145, 122, 165, 122, 220, 182, 191, 134, 150]
- }
- ]
- }
- myChart4.setOption(option4)
- }
- </script>
|