@websy/websy-designs 1.7.8 → 1.7.9

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.
@@ -7402,7 +7402,8 @@ class WebsyChart {
7402
7402
  brushHeight: 50,
7403
7403
  minBandWidth: 30,
7404
7404
  maxBandWidth: 100,
7405
- allowUnevenBands: true
7405
+ allowUnevenBands: true,
7406
+ balancedMinMax: false
7406
7407
  }
7407
7408
  this.elementId = elementId
7408
7409
  this.options = Object.assign({}, DEFAULTS, options)
@@ -8065,6 +8066,22 @@ else {
8065
8066
  if (this.options.data.right.formatter) {
8066
8067
  this.longestRight = this.options.data.right.formatter(this.options.data.right.max).toString()
8067
8068
  }
8069
+ }
8070
+ // Check to see if we need to balance the min and max values
8071
+ if (this.options.balancedMinMax) {
8072
+ if (this.options.orientation === 'horizontal') {
8073
+ let biggestBottom = Math.max(Math.abs(this.options.data.bottom.min, this.options.data.bottom.max))
8074
+ this.options.data.bottom.min = 1 - biggestBottom
8075
+ this.options.data.bottom.max = biggestBottom
8076
+ }
8077
+ else {
8078
+ let biggestLeft = Math.max(Math.abs(this.options.data.left.min, this.options.data.left.max))
8079
+ this.options.data.left.min = 1 - biggestLeft
8080
+ this.options.data.left.max = biggestLeft
8081
+ let biggestRight = Math.max(Math.abs(this.options.data.right.min, this.options.data.right.max))
8082
+ this.options.data.right.min = 1 - biggestRight
8083
+ this.options.data.right.max = biggestRight
8084
+ }
8068
8085
  }
8069
8086
  // establish the space needed for the various axes
8070
8087
  // this.options.margin.axisLeft = this.longestLeft * ((this.options.data.left && this.options.data.left.fontSize) || this.options.fontSize) * 0.7
@@ -8246,7 +8263,7 @@ else {
8246
8263
  // }
8247
8264
  // }
8248
8265
  // Translate the layers
8249
- const leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight + 5 : 0
8266
+ const leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0
8250
8267
  this.leftAxisLayer
8251
8268
  .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8252
8269
  .style('font-size', (this.options.data.left && this.options.data.left.fontSize) || this.options.fontSize)
@@ -8263,23 +8280,23 @@ else {
8263
8280
  this.bottomAxisLabel
8264
8281
  .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop + this.plotHeight})`)
8265
8282
  this.plotArea
8266
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8283
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8267
8284
  this.areaLayer
8268
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8285
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8269
8286
  this.lineLayer
8270
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8287
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8271
8288
  this.barLayer
8272
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8289
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8273
8290
  this.labelLayer
8274
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8291
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8275
8292
  this.symbolLayer
8276
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8293
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8277
8294
  this.refLineLayer
8278
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8295
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8279
8296
  this.trackingLineLayer
8280
- .attr('transform', `translate(${leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8297
+ .attr('transform', `translate(${leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft}, ${this.options.margin.top + this.options.margin.axisTop})`)
8281
8298
  this.clip
8282
- .attr('transform', `translate(${(leftBrushAdjustment - 5) + this.options.margin.left + this.options.margin.axisLeft}, 0)`)
8299
+ .attr('transform', `translate(${(leftBrushAdjustment) + this.options.margin.left + this.options.margin.axisLeft}, 0)`)
8283
8300
  .attr('width', this.plotWidth)
8284
8301
  .attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop)
8285
8302
  if (this.options.orientation === 'horizontal') {
@@ -8836,9 +8853,9 @@ function getBarWidth (d, i, yAxis, xAxis) {
8836
8853
  let output
8837
8854
  if (this.options.orientation === 'horizontal') {
8838
8855
  // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8839
- output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8856
+ // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8840
8857
  // output = (this[`${yAxis}Axis`](0)) + this[`${yAxis}Axis`](Math.abs(d.y.value))
8841
- // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8858
+ output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8842
8859
  }
8843
8860
  else {
8844
8861
  let x = getBarX.call(this, d, i, yAxis, xAxis)
@@ -8874,11 +8891,21 @@ function getBarX (d, i, yAxis, xAxis) {
8874
8891
  let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, yAxis, xAxis)
8875
8892
  let h = getBarWidth.call(this, d, i, yAxis, xAxis)
8876
8893
  // output = (this[`${yAxis}Axis`](0)) + ((accH + h) * (d.y.accumulative > 0 ? 0 : 1))
8877
- output = (this[`${yAxis}Axis`](0)) + ((accH) * (d.y.accumulative > 0 ? 1 : 0))
8894
+ if (d.y.value >= 0) {
8895
+ output = (this[`${yAxis}Axis`](0)) + ((Math.abs(accH)) * (d.y.accumulative > 0 ? 1 : 0))
8896
+ }
8897
+ else {
8898
+ output = (this[`${yAxis}Axis`](0)) - ((Math.abs(accH) + Math.abs(h)) * (d.y.accumulative > 0 ? 1 : 0))
8899
+ }
8878
8900
  }
8879
8901
  else {
8880
8902
  let h = getBarWidth.call(this, d, i, yAxis, xAxis)
8881
- output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value > 0 ? 0 : 1))
8903
+ if (d.y.value >= 0) {
8904
+ output = (this[`${yAxis}Axis`](0))
8905
+ }
8906
+ else {
8907
+ output = (this[`${yAxis}Axis`](0)) + h
8908
+ }
8882
8909
  }
8883
8910
  }
8884
8911
  else {
@@ -9064,26 +9091,30 @@ if (this.options.showLabels === true || series.showLabels === true) {
9064
9091
  this.setAttribute('text-anchor', 'middle')
9065
9092
  }
9066
9093
  else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
9094
+ console.log('anhor end for', d.y.value)
9067
9095
  this.setAttribute('text-anchor', 'end')
9068
9096
  this.setAttribute('x', +(this.getAttribute('x')) - 8)
9069
9097
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
9070
9098
  }
9071
- else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9072
- this.setAttribute('text-anchor', 'end')
9073
- this.setAttribute('x', +(this.getAttribute('x')) - 8)
9074
- this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
9075
- }
9076
- else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9099
+ else if (d.y.value < 0 && this.getAttribute('x') < 0) {
9077
9100
  this.setAttribute('text-anchor', 'start')
9078
- this.setAttribute('x', +(this.getAttribute('x')) + 8)
9101
+ this.setAttribute('x', Math.max(+(this.getAttribute('x')) + 8, 8))
9079
9102
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
9080
9103
  }
9104
+ else if (d.y.value < 0 && this.getAttribute('x') > 0) {
9105
+ console.log('anhor end for', d.y.value)
9106
+ this.setAttribute('text-anchor', 'end')
9107
+ this.setAttribute('x', +(this.getAttribute('x')) - 8)
9108
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
9109
+ }
9081
9110
  else if (series.labelPosition === 'outside') {
9082
9111
  this.setAttribute('text-anchor', 'start')
9083
9112
  this.setAttribute('x', +(this.getAttribute('x')) + 8)
9084
9113
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
9085
9114
  }
9086
- else {
9115
+ else {
9116
+ console.log('anhor end for', d.y.value)
9117
+ this.setAttribute('text-anchor', 'start')
9087
9118
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
9088
9119
  }
9089
9120
  }
@@ -8187,7 +8187,8 @@ var WebsyChart = /*#__PURE__*/function () {
8187
8187
  brushHeight: 50,
8188
8188
  minBandWidth: 30,
8189
8189
  maxBandWidth: 100,
8190
- allowUnevenBands: true
8190
+ allowUnevenBands: true,
8191
+ balancedMinMax: false
8191
8192
  };
8192
8193
  this.elementId = elementId;
8193
8194
  this.options = _extends({}, DEFAULTS, options);
@@ -8945,6 +8946,22 @@ var WebsyChart = /*#__PURE__*/function () {
8945
8946
  if (this.options.data.right.formatter) {
8946
8947
  this.longestRight = this.options.data.right.formatter(this.options.data.right.max).toString();
8947
8948
  }
8949
+ } // Check to see if we need to balance the min and max values
8950
+
8951
+
8952
+ if (this.options.balancedMinMax) {
8953
+ if (this.options.orientation === 'horizontal') {
8954
+ var biggestBottom = Math.max(Math.abs(this.options.data.bottom.min, this.options.data.bottom.max));
8955
+ this.options.data.bottom.min = 1 - biggestBottom;
8956
+ this.options.data.bottom.max = biggestBottom;
8957
+ } else {
8958
+ var biggestLeft = Math.max(Math.abs(this.options.data.left.min, this.options.data.left.max));
8959
+ this.options.data.left.min = 1 - biggestLeft;
8960
+ this.options.data.left.max = biggestLeft;
8961
+ var biggestRight = Math.max(Math.abs(this.options.data.right.min, this.options.data.right.max));
8962
+ this.options.data.right.min = 1 - biggestRight;
8963
+ this.options.data.right.max = biggestRight;
8964
+ }
8948
8965
  } // establish the space needed for the various axes
8949
8966
  // this.options.margin.axisLeft = this.longestLeft * ((this.options.data.left && this.options.data.left.fontSize) || this.options.fontSize) * 0.7
8950
8967
  // this.options.margin.axisRight = this.longestRight * ((this.options.data.right && this.options.data.right.fontSize) || this.options.fontSize) * 0.7
@@ -9143,22 +9160,22 @@ var WebsyChart = /*#__PURE__*/function () {
9143
9160
  // Translate the layers
9144
9161
 
9145
9162
 
9146
- var leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight + 5 : 0;
9163
+ var leftBrushAdjustment = this.brushNeeded === true ? this.options.brushHeight : 0;
9147
9164
  this.leftAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.left && this.options.data.left.fontSize || this.options.fontSize);
9148
9165
  this.rightAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.plotWidth + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")")).style('font-size', this.options.data.right && this.options.data.right.fontSize || this.options.fontSize);
9149
9166
  this.bottomAxisLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")")).style('font-size', this.options.data.bottom && this.options.data.bottom.fontSize || this.options.fontSize);
9150
9167
  this.leftAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9151
9168
  this.rightAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.plotWidth + this.options.margin.axisLeft + this.options.margin.axisRight, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9152
9169
  this.bottomAxisLabel.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop + this.plotHeight, ")"));
9153
- this.plotArea.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9154
- this.areaLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9155
- this.lineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9156
- this.barLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9157
- this.labelLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9158
- this.symbolLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9159
- this.refLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9160
- this.trackingLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9161
- this.clip.attr('transform', "translate(".concat(leftBrushAdjustment - 5 + this.options.margin.left + this.options.margin.axisLeft, ", 0)")).attr('width', this.plotWidth).attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop);
9170
+ this.plotArea.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9171
+ this.areaLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9172
+ this.lineLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9173
+ this.barLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9174
+ this.labelLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9175
+ this.symbolLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9176
+ this.refLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9177
+ this.trackingLineLayer.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
9178
+ this.clip.attr('transform', "translate(".concat(leftBrushAdjustment + this.options.margin.left + this.options.margin.axisLeft, ", 0)")).attr('width', this.plotWidth).attr('height', this.plotHeight + this.options.margin.top + this.options.margin.axisTop);
9162
9179
 
9163
9180
  if (this.options.orientation === 'horizontal') {
9164
9181
  this.brushLayer.attr('transform', "translate(".concat(this.options.margin.left, ", ").concat(this.options.margin.top + this.options.margin.axisTop, ")"));
@@ -9669,8 +9686,9 @@ var WebsyChart = /*#__PURE__*/function () {
9669
9686
 
9670
9687
  if (this.options.orientation === 'horizontal') {
9671
9688
  // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
9672
- output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) + this[`${yAxis}Axis`](Math.abs(d.y.value))
9673
- // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9689
+ // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
9690
+ // output = (this[`${yAxis}Axis`](0)) + this[`${yAxis}Axis`](Math.abs(d.y.value))
9691
+ output = this["".concat(yAxis, "Axis")](0) - this["".concat(yAxis, "Axis")](Math.abs(d.y.value));
9674
9692
  } else {
9675
9693
  var x = getBarX.call(this, d, i, yAxis, xAxis);
9676
9694
 
@@ -9717,11 +9735,19 @@ var WebsyChart = /*#__PURE__*/function () {
9717
9735
  }, i, yAxis, xAxis);
9718
9736
  var h = getBarWidth.call(this, d, i, yAxis, xAxis); // output = (this[`${yAxis}Axis`](0)) + ((accH + h) * (d.y.accumulative > 0 ? 0 : 1))
9719
9737
 
9720
- output = this["".concat(yAxis, "Axis")](0) + accH * (d.y.accumulative > 0 ? 1 : 0);
9738
+ if (d.y.value >= 0) {
9739
+ output = this["".concat(yAxis, "Axis")](0) + Math.abs(accH) * (d.y.accumulative > 0 ? 1 : 0);
9740
+ } else {
9741
+ output = this["".concat(yAxis, "Axis")](0) - (Math.abs(accH) + Math.abs(h)) * (d.y.accumulative > 0 ? 1 : 0);
9742
+ }
9721
9743
  } else {
9722
9744
  var _h = getBarWidth.call(this, d, i, yAxis, xAxis);
9723
9745
 
9724
- output = this["".concat(yAxis, "Axis")](0) + _h * (d.y.value > 0 ? 0 : 1);
9746
+ if (d.y.value >= 0) {
9747
+ output = this["".concat(yAxis, "Axis")](0);
9748
+ } else {
9749
+ output = this["".concat(yAxis, "Axis")](0) + _h;
9750
+ }
9725
9751
  }
9726
9752
  } else {
9727
9753
  // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2
@@ -9921,22 +9947,26 @@ var WebsyChart = /*#__PURE__*/function () {
9921
9947
  if (that.options.grouping === 'stacked' && series.labelPosition !== 'outside') {
9922
9948
  this.setAttribute('text-anchor', 'middle');
9923
9949
  } else if (that.plotWidth - getLabelX.call(that, d) < this.getComputedTextLength()) {
9950
+ console.log('anhor end for', d.y.value);
9924
9951
  this.setAttribute('text-anchor', 'end');
9925
9952
  this.setAttribute('x', +this.getAttribute('x') - 8);
9926
9953
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9927
- } else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9954
+ } else if (d.y.value < 0 && this.getAttribute('x') < 0) {
9955
+ this.setAttribute('text-anchor', 'start');
9956
+ this.setAttribute('x', Math.max(+this.getAttribute('x') + 8, 8));
9957
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9958
+ } else if (d.y.value < 0 && this.getAttribute('x') > 0) {
9959
+ console.log('anhor end for', d.y.value);
9928
9960
  this.setAttribute('text-anchor', 'end');
9929
9961
  this.setAttribute('x', +this.getAttribute('x') - 8);
9930
9962
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9931
- } else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9932
- this.setAttribute('text-anchor', 'start');
9933
- this.setAttribute('x', +this.getAttribute('x') + 8);
9934
- this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9935
9963
  } else if (series.labelPosition === 'outside') {
9936
9964
  this.setAttribute('text-anchor', 'start');
9937
9965
  this.setAttribute('x', +this.getAttribute('x') + 8);
9938
9966
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9939
9967
  } else {
9968
+ console.log('anhor end for', d.y.value);
9969
+ this.setAttribute('text-anchor', 'start');
9940
9970
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9941
9971
  }
9942
9972
  } else {