axidio-styleguide-library1-v2 0.0.776 → 0.0.777

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8055,11 +8055,16 @@ class HorizontalBarsWithScrollZoomComponent extends ComponentUniqueId {
8055
8055
  })
8056
8056
  .attr('transform', function (d, i) {
8057
8057
  if (isMobile) {
8058
- // Get current x from parent tick's transform
8059
- var tick = d3.select(this.parentNode);
8060
- var match = /translate\(([^,]+),/.exec(tick.attr('transform'));
8061
- var x = match ? parseFloat(match[1]) : 0;
8062
- return 'translate(' + x + ',0)';
8058
+ var totalBars = 0;
8059
+ if (this.parentNode && this.parentNode.parentNode) {
8060
+ totalBars = d3.select(this.parentNode.parentNode).selectAll('g.tick').size();
8061
+ }
8062
+ if (totalBars === 2) {
8063
+ return 'translate(0,0)';
8064
+ }
8065
+ else {
8066
+ return 'translate(' + (i * 25) + ',0)';
8067
+ }
8063
8068
  }
8064
8069
  return null;
8065
8070
  });