This is an automated email from the ASF dual-hosted git repository.

stigahuang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/impala.git

commit 9f75318c65d4ed73315c24fb88518060f8756dcf
Author: Surya Hebbar <[email protected]>
AuthorDate: Fri Jun 2 03:46:30 2023 +0530

    IMPALA-12178: Refined alignment for timeticks in query timeline
    
    The timetick labels overflow for some samples with moderate
    lengths, while positioning the timeticks through SVG.
    
    This behaviour is fixed by positioning the <text>
    elements containing labels with appropriate coordinates,
    without aligning <text> to center through 'get_svg_text()'.
    
    Change-Id: Ia74433219e09993b1b0326027d86c2f96bb88639
    Reviewed-on: http://gerrit.cloudera.org:8080/19997
    Reviewed-by: Impala Public Jenkins <[email protected]>
    Tested-by: Impala Public Jenkins <[email protected]>
---
 www/query_timeline.tmpl | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/www/query_timeline.tmpl b/www/query_timeline.tmpl
index 9061c7b12..0f00e3d81 100644
--- a/www/query_timeline.tmpl
+++ b/www/query_timeline.tmpl
@@ -525,14 +525,16 @@ function renderTiming(ignored_arg) {
   var px_per_tic = chart_width / ntics;
   var x = name_width;
   var decimals = 2;
+  var timetick_label;
   for (var i = 1; i <= ntics; ++i) {
     var y = rownum_l * row_height;
     timeticks_footer.appendChild(get_svg_rect("#000000", x, y, px_per_tic,
         row_height, false));
     timeticks_footer.appendChild(get_svg_rect("#F0F0F0", x + 1, y + 1, 
px_per_tic - 2,
         row_height - 2, false));
-    timeticks_footer.appendChild(get_svg_text((i * 
sec_per_tic).toFixed(decimals),
-        "#000000", x + px_per_tic - decimals * char_width, text_y - 2, 
row_height, true));
+    timetick_label = (i * sec_per_tic).toFixed(decimals);
+    timeticks_footer.appendChild(get_svg_text(timetick_label, "#000000",
+        x + px_per_tic - timetick_label.length * char_width + 2, text_y, 
row_height, false));
     x += px_per_tic;
   }
 }

Reply via email to