uniapp__微信小程序使用秋云ucharts折线图双轴

uniapp__微信小程序使用秋云ucharts折线图双轴_第1张图片

1、子组件






2、父组件


	getChartData() {
				const startTime = new Date();
				let timePoints = [];
				for (let i = 0; i < 6; i++) {
					const time = new Date(startTime.getTime() + i * 5000);
					const formattedTime = `${time.getHours()}:${time.getMinutes()}:${time.getSeconds()}`;
					timePoints.push(formattedTime);
				}
				setTimeout(() => {
					this.chartData = {
						categories: timePoints,
						series: [{
								name: "心率",
								data: [35, 8, 25, 37, 4, 20],
								index: 0
							},
							{
								name: "呼吸",
								data: [2, 4, 3, 1, 4, 1],
								index: 1
							}
						]
					};
				}, 100);
			
			},

 双轴series: [{
                                name: "心率",
                                data: [35, 8, 25, 37, 4, 20],
                                index: 0
                            },
                            {
                                name: "呼吸",
                                data: [2, 4, 3, 1, 4, 1],
                                index: 1
                            }
                        ]数据区分使用index

你可能感兴趣的:(秋云echarts,uni-app,微信小程序,小程序)