完善图例和样式设置;调整属性框的最大长度
This commit is contained in:
@@ -36,38 +36,38 @@ const StyleLegend: React.FC<LegendStyleConfig> = ({
|
||||
const color = colors[index]; // 默认颜色为黑色
|
||||
const dimension = dimensions[index]; // 默认尺寸为16
|
||||
|
||||
// 处理第一个区间(小于 breaks[0])
|
||||
if (index === 0) {
|
||||
return (
|
||||
<Box key={index} className="flex items-center gap-2 mb-1">
|
||||
<Box
|
||||
sx={
|
||||
type === "point"
|
||||
? {
|
||||
width: dimension,
|
||||
height: dimension,
|
||||
borderRadius: "50%",
|
||||
backgroundColor: color,
|
||||
}
|
||||
: {
|
||||
width: 16,
|
||||
height: dimension,
|
||||
backgroundColor: color,
|
||||
border: `1px solid ${color}`,
|
||||
}
|
||||
}
|
||||
/>
|
||||
<Typography variant="caption" className="text-xs">
|
||||
{"<"} {breaks[0]?.toFixed(1)}
|
||||
</Typography>
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
// // 处理第一个区间(小于 breaks[0])
|
||||
// if (index === 0) {
|
||||
// return (
|
||||
// <Box key={index} className="flex items-center gap-2 mb-1">
|
||||
// <Box
|
||||
// sx={
|
||||
// type === "point"
|
||||
// ? {
|
||||
// width: dimension,
|
||||
// height: dimension,
|
||||
// borderRadius: "50%",
|
||||
// backgroundColor: color,
|
||||
// }
|
||||
// : {
|
||||
// width: 16,
|
||||
// height: dimension,
|
||||
// backgroundColor: color,
|
||||
// border: `1px solid ${color}`,
|
||||
// }
|
||||
// }
|
||||
// />
|
||||
// <Typography variant="caption" className="text-xs">
|
||||
// {"<"} {breaks[0]?.toFixed(1)}
|
||||
// </Typography>
|
||||
// </Box>
|
||||
// );
|
||||
// }
|
||||
|
||||
// 处理中间区间(breaks[index-1] - breaks[index])
|
||||
if (index < breaks.length) {
|
||||
const prevValue = breaks[index - 1];
|
||||
const currentValue = breaks[index];
|
||||
// 处理中间区间(breaks[index] - breaks[index + 1])
|
||||
if (index + 1 < breaks.length) {
|
||||
const prevValue = breaks[index];
|
||||
const currentValue = breaks[index + 1];
|
||||
return (
|
||||
<Box key={index} className="flex items-center gap-2 mb-1">
|
||||
<Box
|
||||
|
||||
Reference in New Issue
Block a user