feat: 测试结果页雷达图样式修改 & 保存图片增加提示

This commit is contained in:
2025-12-06 19:05:10 +08:00
parent 2b3f1aadfa
commit db293350f0
4 changed files with 36 additions and 20 deletions

View File

@@ -38,13 +38,13 @@ const RadarChart: React.FC = forwardRef((props, ref) => {
canvas.width = res[0].width * dpr;
canvas.height = res[0].height * dpr;
ctx.scale(dpr, dpr);
// 启用抗锯齿,消除锯齿
ctx.imageSmoothingEnabled = true;
ctx.imageSmoothingQuality = 'high';
ctx.imageSmoothingQuality = "high";
// 设置线条端点样式为圆形,减少锯齿
ctx.lineCap = 'round';
ctx.lineJoin = 'round';
ctx.lineCap = "round";
ctx.lineJoin = "round";
// === 绘制圆形网格 ===
for (let i = levels; i >= 1; i--) {
@@ -52,10 +52,10 @@ const RadarChart: React.FC = forwardRef((props, ref) => {
ctx.beginPath();
ctx.arc(center.x, center.y, r, 0, Math.PI * 2);
if (i % 2 === 1) {
ctx.fillStyle = "#fff";
ctx.fillStyle = "rgba(255, 255, 255, 0.4)";
ctx.fill();
} else {
ctx.fillStyle = "#CAFCF0";
ctx.fillStyle = "rgba(149, 249, 225, 0.4)";
ctx.fill();
}
// 根据层级设置不同的线条颜色,中间圆圈使用更浅的颜色
@@ -70,7 +70,7 @@ const RadarChart: React.FC = forwardRef((props, ref) => {
ctx.strokeStyle = "#D5D5D5";
}
// 设置线条宽度为1px确保清晰
ctx.lineWidth = 1;
ctx.lineWidth = 0.5;
ctx.stroke();
}