1 line
3.8 KiB
JSON
1 line
3.8 KiB
JSON
|
|
{"remainingRequest":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\dashboard\\LineChart.vue?vue&type=script&lang=js","dependencies":[{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\src\\views\\dashboard\\LineChart.vue","mtime":1732871026690},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\babel-loader\\lib\\index.js","mtime":1732872825017},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\cache-loader\\dist\\cjs.js","mtime":1732872824662},{"path":"D:\\data\\hanguodoushan\\acs2\\nladmin-ui\\node_modules\\vue-loader\\lib\\index.js","mtime":1732872825835}],"contextDependencies":[],"result":["//\n//\n//\n//\n\r\nimport echarts from 'echarts'\r\nrequire('echarts/theme/macarons') // echarts theme\r\nimport resize from './mixins/resize'\r\n\r\nexport default {\r\n mixins: [resize],\r\n props: {\r\n className: {\r\n type: String,\r\n default: 'chart'\r\n },\r\n width: {\r\n type: String,\r\n default: '100%'\r\n },\r\n height: {\r\n type: String,\r\n default: '350px'\r\n },\r\n autoResize: {\r\n type: Boolean,\r\n default: true\r\n },\r\n chartData: {\r\n type: Object,\r\n required: true\r\n }\r\n },\r\n data() {\r\n return {\r\n chart: null\r\n }\r\n },\r\n watch: {\r\n chartData: {\r\n deep: true,\r\n handler(val) {\r\n this.setOptions(val)\r\n }\r\n }\r\n },\r\n mounted() {\r\n this.$nextTick(() => {\r\n this.initChart()\r\n })\r\n },\r\n beforeDestroy() {\r\n if (!this.chart) {\r\n return\r\n }\r\n this.chart.dispose()\r\n this.chart = null\r\n },\r\n methods: {\r\n initChart() {\r\n this.chart = echarts.init(this.$el, 'macarons')\r\n this.setOptions(this.chartData)\r\n },\r\n setOptions({ expectedData, actualData } = {}) {\r\n this.chart.setOption({\r\n xAxis: {\r\n data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],\r\n boundaryGap: false,\r\n axisTick: {\r\n show: false\r\n }\r\n },\r\n grid: {\r\n left: 10,\r\n right: 10,\r\n bottom: 20,\r\n top: 30,\r\n containLabel: true\r\n },\r\n tooltip: {\r\n trigger: 'axis',\r\n axisPointer: {\r\n type: 'cross'\r\n },\r\n padding: [5, 10]\r\n },\r\n yAxis: {\r\n axisTick: {\r\n show: false\r\n }\r\n },\r\n legend: {\r\n data: ['expected', 'actual']\r\n },\r\n series: [{\r\n name: 'expected', itemStyle: {\r\n normal: {\r\n color: '#FF005A',\r\n lineStyle: {\r\n color: '#FF005A',\r\n width: 2\r\n }\r\n }\r\n },\r\n smooth: true,\r\n type: 'line',\r\n data: expectedData,\r\n animationDuration: 2800,\r\n animationEasing: 'cubicInOut'\r\n },\r\n {\r\n name: 'actual',\r\n smooth: true,\r\n type: 'line',\r\n itemStyle: {\r\n normal: {\r\n color: '#3888fa',\r\n lineStyle: {\r\n color: '#3888fa',\r\n width: 2\r\n },\r\n areaStyle: {\r\n color: '#f3f8ff'\r\n }\r\n }\r\n },\r\n data: actualData,\r\n animationDuration: 2800,\r\n animationEasing: 'quadraticOut'\r\n }]\r\n })\r\n }\r\n }\r\n}\r\n",null]}
|