|
@@ -178,28 +178,9 @@ import {
|
|
guijiFagao,
|
|
guijiFagao,
|
|
} from "@/api/index";
|
|
} from "@/api/index";
|
|
|
|
|
|
-import * as echarts from "echarts/core";
|
|
|
|
-import { LineChart } from "echarts/charts";
|
|
|
|
-import {
|
|
|
|
- GridComponent,
|
|
|
|
- ToolboxComponent,
|
|
|
|
- VisualMapComponent,
|
|
|
|
- LegendComponent,
|
|
|
|
-} from "echarts/components";
|
|
|
|
-import { LabelLayout, UniversalTransition } from "echarts/features";
|
|
|
|
-import { CanvasRenderer } from "echarts/renderers";
|
|
|
|
|
|
+import * as echarts from "echarts";
|
|
const ElLoading = require("element-plus/lib/el-loading/index");
|
|
const ElLoading = require("element-plus/lib/el-loading/index");
|
|
import "element-plus/lib/theme-chalk/el-loading.css";
|
|
import "element-plus/lib/theme-chalk/el-loading.css";
|
|
-echarts.use([
|
|
|
|
- GridComponent,
|
|
|
|
- LineChart,
|
|
|
|
- CanvasRenderer,
|
|
|
|
- ToolboxComponent,
|
|
|
|
- VisualMapComponent,
|
|
|
|
- LabelLayout,
|
|
|
|
- UniversalTransition,
|
|
|
|
- LegendComponent,
|
|
|
|
-]);
|
|
|
|
let lineH = 0;
|
|
let lineH = 0;
|
|
export default {
|
|
export default {
|
|
name: "defaultComponent",
|
|
name: "defaultComponent",
|
|
@@ -309,9 +290,9 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
trendChart(li) {
|
|
trendChart(li) {
|
|
- this.chart1 = echarts.init(this.$refs.trendChartEle);
|
|
|
|
|
|
+ let chart1 = echarts.init(this.$refs.trendChartEle);
|
|
lineH = (this.$refs.trendChartEle.offsetWidth * 9) / 16;
|
|
lineH = (this.$refs.trendChartEle.offsetWidth * 9) / 16;
|
|
- this.chart1.resize({
|
|
|
|
|
|
+ chart1.resize({
|
|
height: (this.$refs.trendChartEle.offsetWidth * 9) / 16,
|
|
height: (this.$refs.trendChartEle.offsetWidth * 9) / 16,
|
|
});
|
|
});
|
|
const keys = [],
|
|
const keys = [],
|
|
@@ -320,11 +301,12 @@ export default {
|
|
keys.push(v.dt);
|
|
keys.push(v.dt);
|
|
val.push(v.playCount);
|
|
val.push(v.playCount);
|
|
});
|
|
});
|
|
- this.chart1.setOption({
|
|
|
|
|
|
+ chart1.setOption({
|
|
tooltip: {
|
|
tooltip: {
|
|
- trigger: "item",
|
|
|
|
|
|
+ trigger: "axis",
|
|
formatter: v => {
|
|
formatter: v => {
|
|
- return v.name + ":" + this.numform(v.data);
|
|
|
|
|
|
+ const item = v[0] || {};
|
|
|
|
+ return (item.name || "") + "<br />" + this.numform(item.value || "");
|
|
},
|
|
},
|
|
},
|
|
},
|
|
legend: {
|
|
legend: {
|
|
@@ -344,6 +326,7 @@ export default {
|
|
},
|
|
},
|
|
series: [
|
|
series: [
|
|
{
|
|
{
|
|
|
|
+ symbol: "none",
|
|
data: val,
|
|
data: val,
|
|
type: "line",
|
|
type: "line",
|
|
smooth: true,
|
|
smooth: true,
|