From 72f41306c2108f53f2e5791caa90f9663f657116 Mon Sep 17 00:00:00 2001 From: Gusted Date: Sun, 18 Aug 2024 18:11:48 +0200 Subject: [PATCH] [UI] Fix misalignment of authors for repo acctivity - Regression of #4571 - We aren't showing the ticks generated by chartjs, because we want to show the avatar of the person instead. You can't *realy* disable that tick, so instead I opted to make them transparent in #4571, however they still affected the generation of ticks so if enough authors were being shown, for some the ticks were being skipped. Adjust the settings to make sure they are always being shown. - Resolves https://codeberg.org/forgejo/forgejo/issues/4982 --- web_src/js/components/RepoActivityTopAuthors.vue | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/web_src/js/components/RepoActivityTopAuthors.vue b/web_src/js/components/RepoActivityTopAuthors.vue index 52986c0493..3752bc582b 100644 --- a/web_src/js/components/RepoActivityTopAuthors.vue +++ b/web_src/js/components/RepoActivityTopAuthors.vue @@ -68,7 +68,16 @@ const sfc = { display: false, }, ticks: { - color: 'transparent', // Disable drawing of labels on the x-axis. + // Disable the drawing of the labels on the x-asis and force them all + // of them to be 'shown', this avoids them being internally skipped + // for some data points. We rely on the internally generated ticks + // to know where to draw our own ticks. Set rotation to 90 degree + // and disable autoSkip. autoSkip is disabled to ensure no ticks are + // skipped and rotation is set to avoid messing with the width of the chart. + color: 'transparent', + minRotation: 90, + maxRotation: 90, + autoSkip: false, }, }, y: {