@websy/websy-designs 1.7.5 → 1.7.7

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.
@@ -6063,7 +6063,7 @@ class WebsyTable3 {
6063
6063
  <div id="${this.elementId}_errorMessage"></div>
6064
6064
  </div>
6065
6065
  </div>
6066
- <div id="${this.elementId}_dropdownContainer"></div>
6066
+ <div id="${this.elementId}_dropdownContainer" class="table-dropdown-container"></div>
6067
6067
  <div id="${this.elementId}_loadingContainer"></div>
6068
6068
  </div>
6069
6069
  `
@@ -6111,7 +6111,12 @@ class WebsyTable3 {
6111
6111
  this.currentData = data
6112
6112
  }
6113
6113
  else {
6114
- bodyEl.innerHTML += this.buildBodyHtml(data, true)
6114
+ if (bodyEl.querySelector('tbody')) {
6115
+ bodyEl.querySelector('tbody').innerHTML += this.buildBodyHtml(data, true, true)
6116
+ }
6117
+ else {
6118
+ bodyEl.innerHTML += this.buildBodyHtml(data, true)
6119
+ }
6115
6120
  this.currentData = this.currentData.concat(data)
6116
6121
  }
6117
6122
  }
@@ -6748,6 +6753,7 @@ class WebsyTable3 {
6748
6753
  return
6749
6754
  }
6750
6755
  // this.data = []
6756
+ this.currentData = []
6751
6757
  // Adjust the sizing of the header/body/footer
6752
6758
  if (calcSizes === true) {
6753
6759
  const sample = this.createSample(data)
@@ -7172,18 +7178,18 @@ class WebsyChart {
7172
7178
  this.render()
7173
7179
  }
7174
7180
  close () {
7175
- this.leftAxisLayer.selectAll('*').remove()
7176
- this.rightAxisLayer.selectAll('*').remove()
7177
- this.bottomAxisLayer.selectAll('*').remove()
7178
- this.leftAxisLabel.selectAll('*').remove()
7179
- this.rightAxisLabel.selectAll('*').remove()
7180
- this.bottomAxisLabel.selectAll('*').remove()
7181
- this.plotArea.selectAll('*').remove()
7182
- this.areaLayer.selectAll('*').remove()
7183
- this.lineLayer.selectAll('*').remove()
7184
- this.barLayer.selectAll('*').remove()
7185
- this.labelLayer.selectAll('*').remove()
7186
- this.symbolLayer.selectAll('*').remove()
7181
+ this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove()
7182
+ this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove()
7183
+ this.bottomAxisLayer && this.bottomAxisLayer.selectAll('*').remove()
7184
+ this.leftAxisLabel && this.leftAxisLabel.selectAll('*').remove()
7185
+ this.rightAxisLabel && this.rightAxisLabel.selectAll('*').remove()
7186
+ this.bottomAxisLabel && this.bottomAxisLabel.selectAll('*').remove()
7187
+ this.plotArea && this.plotArea.selectAll('*').remove()
7188
+ this.areaLayer && this.areaLayer.selectAll('*').remove()
7189
+ this.lineLayer && this.lineLayer.selectAll('*').remove()
7190
+ this.barLayer && this.barLayer.selectAll('*').remove()
7191
+ this.labelLayer && this.labelLayer.selectAll('*').remove()
7192
+ this.symbolLayer && this.symbolLayer.selectAll('*').remove()
7187
7193
  }
7188
7194
  createDomain (side, forBrush = false) {
7189
7195
  let domain = []
@@ -8394,7 +8400,8 @@ function getBarHeight (d, i, yAxis, xAxis) {
8394
8400
  function getBarWidth (d, i, xAxis) {
8395
8401
  let output
8396
8402
  if (this.options.orientation === 'horizontal') {
8397
- output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8403
+ // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
8404
+ output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8398
8405
  // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
8399
8406
  }
8400
8407
  else {
@@ -8412,20 +8419,29 @@ function getBarWidth (d, i, xAxis) {
8412
8419
  function getBarX (d, i, xAxis) {
8413
8420
  let output
8414
8421
  if (this.options.orientation === 'horizontal') {
8415
- if (this.options.grouping === 'stacked') {
8416
- // let h = getBarWidth.call(this, d, i, xAxis)
8417
- // let adjustment = 0
8418
- // if (d.y.accumulative && d.y.accumulative !== 0) {
8419
- // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
8420
- // }
8421
- // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
8422
- let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, xAxis)
8423
- // let h = getBarWidth.call(this, d, i, xAxis)
8424
- output = (accH * (d.y.accumulative < 0 ? 0 : 1))
8422
+ // if (this.options.grouping === 'stacked') {
8423
+ // // let h = getBarWidth.call(this, d, i, xAxis)
8424
+ // // let adjustment = 0
8425
+ // // if (d.y.accumulative && d.y.accumulative !== 0) {
8426
+ // // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
8427
+ // // }
8428
+ // // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
8429
+ // let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, xAxis)
8430
+ // // let h = getBarWidth.call(this, d, i, xAxis)
8431
+ // output = (accH * (d.y.accumulative < 0 ? 0 : 1))
8432
+ // }
8433
+ // else {
8434
+ // let h = getBarWidth.call(this, d, i, xAxis)
8435
+ // output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value < 0 ? 1 : 0))
8436
+ // }
8437
+ if (this.options.grouping === 'stacked') { // no support for stacks yet
8438
+ let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, xAxis)
8439
+ let h = getBarWidth.call(this, d, i, xAxis)
8440
+ output = (this[`${yAxis}Axis`](0)) + ((accH + h) * (d.y.accumulative > 0 ? 0 : 1))
8425
8441
  }
8426
8442
  else {
8427
8443
  let h = getBarWidth.call(this, d, i, xAxis)
8428
- output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value < 0 ? 1 : 0))
8444
+ output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value > 0 ? 0 : 1))
8429
8445
  }
8430
8446
  }
8431
8447
  else {
@@ -8614,7 +8630,17 @@ if (this.options.showLabels === true || series.showLabels === true) {
8614
8630
  this.setAttribute('text-anchor', 'end')
8615
8631
  this.setAttribute('x', +(this.getAttribute('x')) - 8)
8616
8632
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
8617
- }
8633
+ }
8634
+ else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
8635
+ this.setAttribute('text-anchor', 'end')
8636
+ this.setAttribute('x', +(this.getAttribute('x')) - 8)
8637
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
8638
+ }
8639
+ else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
8640
+ this.setAttribute('text-anchor', 'start')
8641
+ this.setAttribute('x', +(this.getAttribute('x')) + 8)
8642
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
8643
+ }
8618
8644
  else if (series.labelPosition === 'outside') {
8619
8645
  this.setAttribute('text-anchor', 'start')
8620
8646
  this.setAttribute('x', +(this.getAttribute('x')) + 8)
@@ -8656,7 +8682,17 @@ if (this.options.showLabels === true || series.showLabels === true) {
8656
8682
  this.setAttribute('text-anchor', 'end')
8657
8683
  this.setAttribute('x', +(this.getAttribute('x')) - 8)
8658
8684
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
8659
- }
8685
+ }
8686
+ else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
8687
+ this.setAttribute('text-anchor', 'end')
8688
+ this.setAttribute('x', +(this.getAttribute('x')) - 8)
8689
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'))
8690
+ }
8691
+ else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
8692
+ this.setAttribute('text-anchor', 'start')
8693
+ this.setAttribute('x', +(this.getAttribute('x')) + 8)
8694
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color))
8695
+ }
8660
8696
  else if (series.labelPosition === 'outside') {
8661
8697
  this.setAttribute('text-anchor', 'start')
8662
8698
  this.setAttribute('x', +(this.getAttribute('x')) + 8)
@@ -6637,7 +6637,7 @@ var WebsyTable3 = /*#__PURE__*/function () {
6637
6637
  var el = document.getElementById(this.elementId);
6638
6638
 
6639
6639
  if (el) {
6640
- var html = "\n <div id='".concat(this.elementId, "_tableContainer' class='websy-vis-table-3 ").concat(this.options.paging === 'pages' ? 'with-paging' : '', " ").concat(this.options.virtualScroll === true ? 'with-virtual-scroll' : '', "'>\n <!--<div class=\"download-button\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M16 11h5l-9 10-9-10h5v-11h8v11zm1 11h-10v2h10v-2z\"/></svg>\n </div>-->\n <div id=\"").concat(this.elementId, "_tableInner\" class=\"websy-table-inner-container\">\n <table id=\"").concat(this.elementId, "_tableHeader\" class=\"websy-table-header\"></table>\n <table id=\"").concat(this.elementId, "_tableBody\" class=\"websy-table-body\"></table>\n <table id=\"").concat(this.elementId, "_tableFooter\" class=\"websy-table-footer\"></table>\n <div id=\"").concat(this.elementId, "_vScrollContainer\" class=\"websy-v-scroll-container\">\n <div id=\"").concat(this.elementId, "_vScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-y\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_hScrollContainer\" class=\"websy-h-scroll-container\">\n <div id=\"").concat(this.elementId, "_hScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-x\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_touchScroller\" class=\"websy-table-touch-scroller hidden\"></div>\n </div> \n <div id=\"").concat(this.elementId, "_errorContainer\" class='websy-vis-error-container'>\n <div>\n <div id=\"").concat(this.elementId, "_errorTitle\"></div>\n <div id=\"").concat(this.elementId, "_errorMessage\"></div>\n </div> \n </div>\n <div id=\"").concat(this.elementId, "_dropdownContainer\"></div>\n <div id=\"").concat(this.elementId, "_loadingContainer\"></div>\n </div>\n ");
6640
+ var html = "\n <div id='".concat(this.elementId, "_tableContainer' class='websy-vis-table-3 ").concat(this.options.paging === 'pages' ? 'with-paging' : '', " ").concat(this.options.virtualScroll === true ? 'with-virtual-scroll' : '', "'>\n <!--<div class=\"download-button\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\"><path d=\"M16 11h5l-9 10-9-10h5v-11h8v11zm1 11h-10v2h10v-2z\"/></svg>\n </div>-->\n <div id=\"").concat(this.elementId, "_tableInner\" class=\"websy-table-inner-container\">\n <table id=\"").concat(this.elementId, "_tableHeader\" class=\"websy-table-header\"></table>\n <table id=\"").concat(this.elementId, "_tableBody\" class=\"websy-table-body\"></table>\n <table id=\"").concat(this.elementId, "_tableFooter\" class=\"websy-table-footer\"></table>\n <div id=\"").concat(this.elementId, "_vScrollContainer\" class=\"websy-v-scroll-container\">\n <div id=\"").concat(this.elementId, "_vScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-y\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_hScrollContainer\" class=\"websy-h-scroll-container\">\n <div id=\"").concat(this.elementId, "_hScrollHandle\" class=\"websy-scroll-handle websy-scroll-handle-x\"></div>\n </div>\n <div id=\"").concat(this.elementId, "_touchScroller\" class=\"websy-table-touch-scroller hidden\"></div>\n </div> \n <div id=\"").concat(this.elementId, "_errorContainer\" class='websy-vis-error-container'>\n <div>\n <div id=\"").concat(this.elementId, "_errorTitle\"></div>\n <div id=\"").concat(this.elementId, "_errorMessage\"></div>\n </div> \n </div>\n <div id=\"").concat(this.elementId, "_dropdownContainer\" class=\"table-dropdown-container\"></div>\n <div id=\"").concat(this.elementId, "_loadingContainer\"></div>\n </div>\n ");
6641
6641
 
6642
6642
  if (this.options.paging === 'pages') {
6643
6643
  html += "\n <div class=\"websy-table-paging-container\">\n Show <div id=\"".concat(this.elementId, "_pageSizeSelector\" class=\"websy-vis-page-selector\"></div> rows\n <ul id=\"").concat(this.elementId, "_pageList\" class=\"websy-vis-page-list\"></ul>\n </div>\n ");
@@ -6675,7 +6675,12 @@ var WebsyTable3 = /*#__PURE__*/function () {
6675
6675
  bodyEl.innerHTML = this.buildBodyHtml(data, true);
6676
6676
  this.currentData = data;
6677
6677
  } else {
6678
- bodyEl.innerHTML += this.buildBodyHtml(data, true);
6678
+ if (bodyEl.querySelector('tbody')) {
6679
+ bodyEl.querySelector('tbody').innerHTML += this.buildBodyHtml(data, true, true);
6680
+ } else {
6681
+ bodyEl.innerHTML += this.buildBodyHtml(data, true);
6682
+ }
6683
+
6679
6684
  this.currentData = this.currentData.concat(data);
6680
6685
  }
6681
6686
  } // this.data = this.data.concat(data)
@@ -7391,9 +7396,10 @@ var WebsyTable3 = /*#__PURE__*/function () {
7391
7396
  console.log("No columns provided for table with ID ".concat(this.elementId));
7392
7397
  return;
7393
7398
  } // this.data = []
7394
- // Adjust the sizing of the header/body/footer
7395
7399
 
7396
7400
 
7401
+ this.currentData = []; // Adjust the sizing of the header/body/footer
7402
+
7397
7403
  if (calcSizes === true) {
7398
7404
  var sample = this.createSample(data);
7399
7405
  this.calculateSizes(sample, data.length, (data[0] || []).length, 0);
@@ -7898,18 +7904,18 @@ var WebsyChart = /*#__PURE__*/function () {
7898
7904
  _createClass(WebsyChart, [{
7899
7905
  key: "close",
7900
7906
  value: function close() {
7901
- this.leftAxisLayer.selectAll('*').remove();
7902
- this.rightAxisLayer.selectAll('*').remove();
7903
- this.bottomAxisLayer.selectAll('*').remove();
7904
- this.leftAxisLabel.selectAll('*').remove();
7905
- this.rightAxisLabel.selectAll('*').remove();
7906
- this.bottomAxisLabel.selectAll('*').remove();
7907
- this.plotArea.selectAll('*').remove();
7908
- this.areaLayer.selectAll('*').remove();
7909
- this.lineLayer.selectAll('*').remove();
7910
- this.barLayer.selectAll('*').remove();
7911
- this.labelLayer.selectAll('*').remove();
7912
- this.symbolLayer.selectAll('*').remove();
7907
+ this.leftAxisLayer && this.leftAxisLayer.selectAll('*').remove();
7908
+ this.rightAxisLayer && this.rightAxisLayer.selectAll('*').remove();
7909
+ this.bottomAxisLayer && this.bottomAxisLayer.selectAll('*').remove();
7910
+ this.leftAxisLabel && this.leftAxisLabel.selectAll('*').remove();
7911
+ this.rightAxisLabel && this.rightAxisLabel.selectAll('*').remove();
7912
+ this.bottomAxisLabel && this.bottomAxisLabel.selectAll('*').remove();
7913
+ this.plotArea && this.plotArea.selectAll('*').remove();
7914
+ this.areaLayer && this.areaLayer.selectAll('*').remove();
7915
+ this.lineLayer && this.lineLayer.selectAll('*').remove();
7916
+ this.barLayer && this.barLayer.selectAll('*').remove();
7917
+ this.labelLayer && this.labelLayer.selectAll('*').remove();
7918
+ this.symbolLayer && this.symbolLayer.selectAll('*').remove();
7913
7919
  }
7914
7920
  }, {
7915
7921
  key: "createDomain",
@@ -9168,7 +9174,8 @@ var WebsyChart = /*#__PURE__*/function () {
9168
9174
  var output;
9169
9175
 
9170
9176
  if (this.options.orientation === 'horizontal') {
9171
- output = this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9177
+ // output = this[`${yAxis}Axis`](Math.abs(d.y.value))
9178
+ output = this["".concat(yAxis, "Axis")](0) - this["".concat(yAxis, "Axis")](Math.abs(d.y.value)); // output = (this[`${yAxis}Axis`](0)) - this[`${yAxis}Axis`](Math.abs(d.y.value))
9172
9179
  } else {
9173
9180
  var x = getBarX.call(this, d, i, xAxis);
9174
9181
 
@@ -9190,24 +9197,35 @@ var WebsyChart = /*#__PURE__*/function () {
9190
9197
  var output;
9191
9198
 
9192
9199
  if (this.options.orientation === 'horizontal') {
9200
+ // if (this.options.grouping === 'stacked') {
9201
+ // // let h = getBarWidth.call(this, d, i, xAxis)
9202
+ // // let adjustment = 0
9203
+ // // if (d.y.accumulative && d.y.accumulative !== 0) {
9204
+ // // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
9205
+ // // }
9206
+ // // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
9207
+ // let accH = getBarWidth.call(this, {x: d.x, y: { value: d.y.accumulative }}, i, xAxis)
9208
+ // // let h = getBarWidth.call(this, d, i, xAxis)
9209
+ // output = (accH * (d.y.accumulative < 0 ? 0 : 1))
9210
+ // }
9211
+ // else {
9212
+ // let h = getBarWidth.call(this, d, i, xAxis)
9213
+ // output = (this[`${yAxis}Axis`](0)) + (h * (d.y.value < 0 ? 1 : 0))
9214
+ // }
9193
9215
  if (this.options.grouping === 'stacked') {
9194
- // let h = getBarWidth.call(this, d, i, xAxis)
9195
- // let adjustment = 0
9196
- // if (d.y.accumulative && d.y.accumulative !== 0) {
9197
- // adjustment = this[`${yAxis}Axis`](d.y.accumulative || 0)
9198
- // }
9199
- // output = this[`${yAxis}Axis`](0) + (adjustment * (d.y.value < 0 ? 1 : 0)) + (h * (d.y.value < 0 ? 1 : 0))
9216
+ // no support for stacks yet
9200
9217
  var accH = getBarWidth.call(this, {
9201
9218
  x: d.x,
9202
9219
  y: {
9203
9220
  value: d.y.accumulative
9204
9221
  }
9205
- }, i, xAxis); // let h = getBarWidth.call(this, d, i, xAxis)
9206
-
9207
- output = accH * (d.y.accumulative < 0 ? 0 : 1);
9208
- } else {
9222
+ }, i, xAxis);
9209
9223
  var h = getBarWidth.call(this, d, i, xAxis);
9210
- output = this["".concat(yAxis, "Axis")](0) + h * (d.y.value < 0 ? 1 : 0);
9224
+ output = this["".concat(yAxis, "Axis")](0) + (accH + h) * (d.y.accumulative > 0 ? 0 : 1);
9225
+ } else {
9226
+ var _h = getBarWidth.call(this, d, i, xAxis);
9227
+
9228
+ output = this["".concat(yAxis, "Axis")](0) + _h * (d.y.value > 0 ? 0 : 1);
9211
9229
  }
9212
9230
  } else {
9213
9231
  // let adjustment = this.options.data[xAxis.replace('Brush', '')].scale === 'Time' ? 0 : this.options.data[xAxis.replace('Brush', '')].bandWidth / 2
@@ -9291,9 +9309,9 @@ var WebsyChart = /*#__PURE__*/function () {
9291
9309
  var h = getBarHeight.call(this, d, i, yAxis, xAxis);
9292
9310
  output = this["".concat(yAxis, "Axis")](0) - (accH + h) * (d.y.accumulative < 0 ? 0 : 1);
9293
9311
  } else {
9294
- var _h = getBarHeight.call(this, d, i, yAxis, xAxis);
9312
+ var _h2 = getBarHeight.call(this, d, i, yAxis, xAxis);
9295
9313
 
9296
- output = this["".concat(yAxis, "Axis")](0) - _h * (d.y.value < 0 ? 0 : 1);
9314
+ output = this["".concat(yAxis, "Axis")](0) - _h2 * (d.y.value < 0 ? 0 : 1);
9297
9315
  }
9298
9316
  }
9299
9317
 
@@ -9410,6 +9428,14 @@ var WebsyChart = /*#__PURE__*/function () {
9410
9428
  this.setAttribute('text-anchor', 'end');
9411
9429
  this.setAttribute('x', +this.getAttribute('x') - 8);
9412
9430
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9431
+ } else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9432
+ this.setAttribute('text-anchor', 'end');
9433
+ this.setAttribute('x', +this.getAttribute('x') - 8);
9434
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9435
+ } else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9436
+ this.setAttribute('text-anchor', 'start');
9437
+ this.setAttribute('x', +this.getAttribute('x') + 8);
9438
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9413
9439
  } else if (series.labelPosition === 'outside') {
9414
9440
  this.setAttribute('text-anchor', 'start');
9415
9441
  this.setAttribute('x', +this.getAttribute('x') + 8);
@@ -9443,6 +9469,14 @@ var WebsyChart = /*#__PURE__*/function () {
9443
9469
  this.setAttribute('text-anchor', 'end');
9444
9470
  this.setAttribute('x', +this.getAttribute('x') - 8);
9445
9471
  this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9472
+ } else if (d.y.value < 0 && d.y.value !== that.options.data[yAxis].min) {
9473
+ this.setAttribute('text-anchor', 'end');
9474
+ this.setAttribute('x', +this.getAttribute('x') - 8);
9475
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark('#ffffff'));
9476
+ } else if (d.y.value < 0 && d.y.value === that.options.data[yAxis].min) {
9477
+ this.setAttribute('text-anchor', 'start');
9478
+ this.setAttribute('x', +this.getAttribute('x') + 8);
9479
+ this.setAttribute('fill', that.options.labelColor || WebsyDesigns.WebsyUtils.getLightDark(d.y.color || d.color || series.color));
9446
9480
  } else if (series.labelPosition === 'outside') {
9447
9481
  this.setAttribute('text-anchor', 'start');
9448
9482
  this.setAttribute('x', +this.getAttribute('x') + 8);