diff --git a/web/src/composables/useLatencyInsightsDashboard.ts b/web/src/composables/useLatencyInsightsDashboard.ts index 7e582c2eda..2c979b32aa 100644 --- a/web/src/composables/useLatencyInsightsDashboard.ts +++ b/web/src/composables/useLatencyInsightsDashboard.ts @@ -367,6 +367,8 @@ export function useLatencyInsightsDashboard() { label_option: { rotate: 45, }, + axis_label_rotate: 30, + axis_label_truncate_width: 80, color: isComparisonMode ? { mode: "palette-classic-by-series", fixedColor: ["#ffc107", "#1976d2"], diff --git a/web/src/utils/dashboard/convertDataIntoUnitValue.ts b/web/src/utils/dashboard/convertDataIntoUnitValue.ts index b8faee7063..a4e05b9039 100644 --- a/web/src/utils/dashboard/convertDataIntoUnitValue.ts +++ b/web/src/utils/dashboard/convertDataIntoUnitValue.ts @@ -1824,8 +1824,11 @@ export const calculateRotatedLabelBottomSpace = ( // Only add if totalNeeded exceeds a reasonable base (e.g., 40px) return Math.max(0, Math.ceil(totalNeededSpace - 40)); } else { - // Without axis name, just add enough space for labels plus a margin - // verticalHeight already includes the diagonal extent - return Math.max(0, Math.ceil(verticalHeight - 15)); // Assuming ~15px is already available + // Without axis name, containLabel: true in grid config handles the space automatically + // for rotated labels. No additional bottom spacing is needed because: + // 1. containLabel: true makes ECharts automatically expand grid to fit labels + // 2. The grid.bottom value already provides base spacing + // 3. Adding extra space here causes unnecessary whitespace + return 10; // Let ECharts handle it with containLabel } }; diff --git a/web/src/utils/dashboard/convertSQLData.ts b/web/src/utils/dashboard/convertSQLData.ts index 9cee2db2e4..2d9122b738 100644 --- a/web/src/utils/dashboard/convertSQLData.ts +++ b/web/src/utils/dashboard/convertSQLData.ts @@ -1068,6 +1068,7 @@ export const convertSQLData = async ( }, tooltip: { trigger: "axis", + confine: true, textStyle: { color: store.state.theme === "dark" ? "#fff" : "#000", fontSize: 12,