feat(echarts): 添加波形图绘制功能支持

- 新增drawWavePic方法用于绘制波形图
- 实现null数据段压缩算法,确保图表性能优化
- 添加markLine和markArea功能显示null段边界标记
- 集成到WavePicComponent组件中支持瞬时和RMS波形图生成
- 修复RestTemplate对Hutool JSON对象的支持问题
- 优化WaveUtil工具类处理空值数据逻辑
This commit is contained in:
xy
2026-06-04 18:27:47 +08:00
parent aafd32c7fc
commit 56cd9a05c3
5 changed files with 691 additions and 65 deletions

View File

@@ -10,9 +10,10 @@ import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
import org.springframework.web.client.RestTemplate;
import java.util.*;
import java.util.List;
import java.util.Map;
import java.util.Objects;
/**
* @author hongawen
@@ -55,7 +56,6 @@ public class DrawPicUtil {
return Objects.requireNonNull(picResult.getBody()).indexOf("image/png") > 0 ? picResult.getBody() : "";
}
/***
* @author hongawen
* 绘制波形图
@@ -77,6 +77,11 @@ public class DrawPicUtil {
return drawPic(instantJson, width, height);
}
public String drawWavePic(String title, List<List<Float>> aValue, List<List<Float>> bValue, List<List<Float>> cValue, String unit, Float max, Float min, String a, String b, String c, List<String> colors, Boolean isOpen, Double lastTime, List<Float> sharedNullBoundaryXValues,Integer nPush) {
String instantJson = LineGenerator.generateWaveOption(title, aValue, bValue, cValue, unit, max, min, a, b, c, colors, isOpen, lastTime, sharedNullBoundaryXValues,nPush);
return drawPic(instantJson, 0, 0);
}
/***
* 绘制itic曲线图