|
@@ -21,7 +21,7 @@ class LineChart extends React.Component {
|
|
|
|
|
|
initChart() {
|
|
|
this.chartInstance = echarts.init(this.chartRef.current);
|
|
|
-
|
|
|
+ console.log('this.props', this.props);
|
|
|
const option = {
|
|
|
backgroundColor: "transparent",
|
|
|
tooltip: { trigger: "axis" },
|
|
@@ -29,12 +29,7 @@ class LineChart extends React.Component {
|
|
|
top: 10,
|
|
|
itemGap: 30,
|
|
|
textStyle: { color: "#fff" },
|
|
|
- data: [
|
|
|
- "海外门户浏览量",
|
|
|
- "海外门户访客数",
|
|
|
- "分销门户浏览量",
|
|
|
- "分销门户访客数",
|
|
|
- ],
|
|
|
+ data: this.props.legendData
|
|
|
},
|
|
|
grid: {
|
|
|
left: "5%",
|
|
@@ -55,14 +50,7 @@ class LineChart extends React.Component {
|
|
|
color: "#ccc",
|
|
|
},
|
|
|
},
|
|
|
- data: [
|
|
|
- "2025-07-08",
|
|
|
- "2025-07-09",
|
|
|
- "2025-07-10",
|
|
|
- "2025-07-11",
|
|
|
- "2025-07-12",
|
|
|
- "2025-07-13",
|
|
|
- ],
|
|
|
+ data: this.props.xAxisData
|
|
|
},
|
|
|
yAxis: {
|
|
|
type: "value",
|
|
@@ -77,80 +65,9 @@ class LineChart extends React.Component {
|
|
|
},
|
|
|
},
|
|
|
},
|
|
|
- series: [
|
|
|
- {
|
|
|
- name: "海外门户浏览量",
|
|
|
- type: "line",
|
|
|
- smooth: false,
|
|
|
- showSymbol: true,
|
|
|
- symbolSize: 10,
|
|
|
- symbol: "circle",
|
|
|
- lineStyle: { width: 2 },
|
|
|
- itemStyle: {
|
|
|
- color: "#7ECEF4",
|
|
|
- },
|
|
|
- // areaStyle: {
|
|
|
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- // { offset: 0, color: "rgba(101,198,255,0.4)" },
|
|
|
- // { offset: 1, color: "rgba(101,198,255,0)" },
|
|
|
- // ]),
|
|
|
- // },
|
|
|
- data: [8000, 6000, 7500, 6200, 7800, 7000],
|
|
|
- },
|
|
|
- {
|
|
|
- name: "海外门户访客数",
|
|
|
- type: "line",
|
|
|
- smooth: false,
|
|
|
- symbolSize: 10,
|
|
|
- showSymbol: true,
|
|
|
- symbol: "circle",
|
|
|
- itemStyle: { color: "#036EB8" },
|
|
|
- lineStyle: { width: 2 },
|
|
|
- // areaStyle: {
|
|
|
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- // { offset: 0, color: "rgba(79,157,255,0.4)" },
|
|
|
- // { offset: 1, color: "rgba(79,157,255,0)" },
|
|
|
- // ]),
|
|
|
- // },
|
|
|
- data: [5000, 2800, 3600, 4000, 6000, 4200],
|
|
|
- },
|
|
|
- {
|
|
|
- name: "分销门户浏览量",
|
|
|
- type: "line",
|
|
|
- smooth: false,
|
|
|
- showSymbol: true,
|
|
|
- symbolSize: 10,
|
|
|
- symbol: "circle",
|
|
|
- itemStyle: { color: "#004E9D" },
|
|
|
- lineStyle: { width: 2 },
|
|
|
- // areaStyle: {
|
|
|
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- // { offset: 0, color: "rgba(115,79,255,0.4)" },
|
|
|
- // { offset: 1, color: "rgba(115,79,255,0)" },
|
|
|
- // ]),
|
|
|
- // },
|
|
|
- data: [2000, 1800, 1000, 0, 4500, 1200],
|
|
|
- },
|
|
|
- {
|
|
|
- name: "分销门户访客数",
|
|
|
- type: "line",
|
|
|
- smooth: false,
|
|
|
- showSymbol: true,
|
|
|
- symbolSize: 10,
|
|
|
- symbol: "circle",
|
|
|
- itemStyle: { color: "#4032A6" },
|
|
|
- lineStyle: { width: 2 },
|
|
|
- // areaStyle: {
|
|
|
- // color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
|
|
- // { offset: 0, color: "rgba(155,95,255,0.4)" },
|
|
|
- // { offset: 1, color: "rgba(155,95,255,0)" },
|
|
|
- // ]),
|
|
|
- // },
|
|
|
- data: [1800, 1500, 600, 0, 1200, 800],
|
|
|
- },
|
|
|
- ],
|
|
|
+ series: this.props.seriesData
|
|
|
};
|
|
|
-
|
|
|
+ console.log('option', option);
|
|
|
this.chartInstance.setOption(option);
|
|
|
}
|
|
|
|