<template> <div class="chart-container"> <div class="chart-header"> <!--标题 --> <span class="title"></span> </div> <div class="chart-content" :style="{'height':height,'width':width}"> <!-- echarts内容 --> <gradientLineChart :seriesData="seriesData" :xAxisData="xAxisData" :legend="legend"/> </div> </div> </template> <script> import gradientLineChart from "../../../components/echart/lineChart/gradientLineChart.vue"; export default { name: "layoutChartSelect", components: { gradientLineChart, }, props: { name: { type: String, default: "", }, width:{ type: String, default: "500px" }, height:{ type: String, default: "250px" } }, data() { return { seriesData: [], xAxisData: [], yAxisData: [], legend: [], }; }, mounted() { setTimeout(() => { this.seriesData = [ { name:'1', data: [820, 932, 901, 934, 1290, 1330, 1320], }, { name:'2', data: [620, 432, 901, 934, 1290, 5330, 820], }, { name:'3', data: [420, 632, 301, 934, 790, 330, 870], }, { name:'4', data: [820, 492, 201, 934, 290, 830, 620], }, ]; this.xAxisData = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]; this.legend=['1','2','3','4'] }, 1000); }, }; </script> <style lang="scss" scoped> .chart-container { .chart-header { width: 600px; align-items: center; display: flex; justify-content: space-between; } .chart-content { // width: 600px; // height: 400px; } } </style>