123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144 |
- <template>
- <el-dialog width="50%" @closed="closed()" :show-close="false" class="my-info-dialog">
- <template #title>
- <div class="showTitles">
- <div class="titles">{{title}}详情</div>
- </div>
- </template>
- <div class="body">
- <div id="detailEcharts" class="echarts"></div>
- </div>
- </el-dialog>
- </template>
- <script>
- import * as echarts from "echarts";
- export default {
- props: {
- title: {
- type: String,
- default: '111',
- required: true,
- },
- },
- updated() {
- this.getEcharts()
- },
- mounted() {
- },
- data(){
- return{
- xdata: []
- }
- },
- methods: {
- getEcharts() {
- let chartDom = document.getElementById('detailEcharts');
- let myChart = echarts.init(chartDom, '#ffffff');
- let option;
- option = {
- legend: {
- show: true,
- data: ["111", "222"],
- right: 56,
- icon: "circle",
- itemWidth: 6,
- inactiveColor: '#606769',
- textStyle: {
- color: '#B3BDC0',
- fontSize: 12,
- },
- },
- // title: {
- // text: 'Income of Germany and France since 1950'
- // },
- tooltip: {
- trigger: 'axis'
- },
- xAxis: [
- {
- type: "category",
- boundaryGap: false,
- axisLabel: {
- interval: 60,
- showMinLabel: true,
- showMaxLabel: true,
- formatter: "{value}",
- fontSize: 14,
- textStyle: {
- color: '#606769',
- },
- },
- axisLine: {
- show: false,
- },
- data: this.xdata,
- },
- ],
- yAxis: {
- type: "value",
- // name: 'y轴',
- axisLabel: {
- formatter: "{value}",
- fontSize: 14,
- },
- axisLine: {
- show: false,
- },
- splitLine: {
- show: true,
- lineStyle: {
- color: '#606769',
- type: "dashed",
- },
- },
- },
- series: [{
- name: '111',
- smooth: true,
- showSymbol: false,
- data: [150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260, 150, 230, 224, 218, 135, 147, 260,],
- type: 'line'
- },
- {
- name: '222',
- smooth: true,
- showSymbol: false,
- data: [50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60, 50, 30, 24, 18, 35, 47, 60,],
- type: 'line'
- }]
- };
- option && myChart.setOption(option);
- },
- closed() {
- this.$emit('closed');
- },
- },
- }
- </script>
- <style>
- .showTitles {
- display: flex;
- flex-direction: row;
- align-items: center;
- justify-content: center;
- margin-top: -10px;
- font-size: 18px;
- color: #FFFFFF;
- }
- .body {
- background-color: black;
- width: 100%;
- margin-top: -30px;
- /* height: 200px; */
- }
- .echarts {
- width: 900px;
- height: 480px;
- /* margin-top: 20px; */
- margin-left: 10px;
- padding-top: 20px;
- }
- </style>
|