Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403184 )

Change subject: Translate g according to the y-axis width
......................................................................

Translate g according to the y-axis width

Before we were using a constant value, so long numbers would cut off

Bug: T184138
Change-Id: I3f8ccb260e31d7effcdb2bf03715ff50fed6a994
---
M src/components/detail/chart/BarChart.vue
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/84/403184/1

diff --git a/src/components/detail/chart/BarChart.vue 
b/src/components/detail/chart/BarChart.vue
index 518a3fd..1487419 100644
--- a/src/components/detail/chart/BarChart.vue
+++ b/src/components/detail/chart/BarChart.vue
@@ -48,9 +48,7 @@
             root.selectAll('*').remove();
 
             const svg = root.append('svg'),
-                  g = svg.append('g').attr(
-                    'transform', `translate(${margin.left + 
padding},${margin.top})`
-                  );
+                  g = svg.append('g');
 
             const n = root.node();
             const activeDict = this.graphModel.getActiveBreakdownValues();
@@ -69,6 +67,9 @@
                 .style('font-size', '13px')
                 .style('font-family', 'Lato, "Open Sans"');
             const yAxisContainerWidth = yAxisContainer.node().getBBox().width;
+            g.attr(
+                'transform', `translate(${yAxisContainerWidth},${margin.top})`
+            );
 
             let width = n.offsetWidth - margin.left - margin.right - 
yAxisContainerWidth;
             let xW = scales.scaleBand()

-- 
To view, visit https://gerrit.wikimedia.org/r/403184
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f8ccb260e31d7effcdb2bf03715ff50fed6a994
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to