折线图
This commit is contained in:
parent
f4d90e74de
commit
fc3e7a9c23
@ -64,6 +64,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
initChart() {
|
||||
console.log(this.chartData);
|
||||
Object.keys(this.chartData).forEach((key) => {
|
||||
this.defaultOption[key] = this.chartData[key];
|
||||
});
|
||||
|
@ -86,8 +86,12 @@ const goTarget = (url: string) => {
|
||||
const indexObj = ref<indexObjOV>();
|
||||
const lineChartsShow = ref(false);
|
||||
const LinechartData = ref({
|
||||
color: 'red',
|
||||
xAxisData: [],
|
||||
// color: 'red',
|
||||
xAxis: {
|
||||
type: 'category',
|
||||
boundaryGap: false,
|
||||
data: []
|
||||
},
|
||||
legend: {},
|
||||
series: [
|
||||
{ name: '用户量', data: [] },
|
||||
@ -99,14 +103,15 @@ const LinechartData = ref({
|
||||
const getList = async () => {
|
||||
const res = await getIndex();
|
||||
indexObj.value = res.data;
|
||||
|
||||
const a = [];
|
||||
res.data?.monthlyUserVolume.forEach((item) => {
|
||||
LinechartData.value.xAxisData.push(item.month);
|
||||
LinechartData.value.xAxis.data.push(item.month);
|
||||
LinechartData.value.series[0].data.push(item.registerMemberCount);
|
||||
LinechartData.value.series[1].data.push(item.loginMemberCount);
|
||||
LinechartData.value.series[2].data.push(item.addCartMemberCount);
|
||||
LinechartData.value.series[3].data.push(item.dealMemberCount);
|
||||
});
|
||||
|
||||
lineChartsShow.value = true;
|
||||
};
|
||||
onMounted(() => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user