billboard.js 3.7.1 → 3.7.3

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.
Files changed (44) hide show
  1. package/dist/billboard.css +1 -1
  2. package/dist/billboard.js +39 -24
  3. package/dist/billboard.min.css +1 -1
  4. package/dist/billboard.min.js +2 -2
  5. package/dist/billboard.pkgd.js +1247 -1193
  6. package/dist/billboard.pkgd.min.js +2 -2
  7. package/dist/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  8. package/dist/plugin/billboardjs-plugin-bubblecompare.min.js +2 -2
  9. package/dist/plugin/billboardjs-plugin-sparkline.js +2 -2
  10. package/dist/plugin/billboardjs-plugin-sparkline.min.js +2 -2
  11. package/dist/plugin/billboardjs-plugin-stanford.js +2 -2
  12. package/dist/plugin/billboardjs-plugin-stanford.min.js +2 -2
  13. package/dist/plugin/billboardjs-plugin-tableview.js +2 -2
  14. package/dist/plugin/billboardjs-plugin-tableview.min.js +2 -2
  15. package/dist/plugin/billboardjs-plugin-textoverlap.js +2 -2
  16. package/dist/plugin/billboardjs-plugin-textoverlap.min.js +2 -2
  17. package/dist/plugin/pkgd/billboardjs-plugin-bubblecompare.js +1159 -1130
  18. package/dist/plugin/pkgd/billboardjs-plugin-sparkline.js +1160 -1131
  19. package/dist/plugin/pkgd/billboardjs-plugin-stanford.js +1204 -1165
  20. package/dist/plugin/pkgd/billboardjs-plugin-tableview.js +1161 -1132
  21. package/dist/plugin/pkgd/billboardjs-plugin-textoverlap.js +1161 -1132
  22. package/dist/theme/datalab.css +1 -1
  23. package/dist/theme/datalab.min.css +1 -1
  24. package/dist/theme/graph.css +1 -1
  25. package/dist/theme/graph.min.css +1 -1
  26. package/dist/theme/insight.css +1 -1
  27. package/dist/theme/insight.min.css +1 -1
  28. package/dist-esm/billboard.js +38 -24
  29. package/dist-esm/plugin/billboardjs-plugin-bubblecompare.js +2 -2
  30. package/dist-esm/plugin/billboardjs-plugin-sparkline.js +2 -2
  31. package/dist-esm/plugin/billboardjs-plugin-stanford.js +2 -2
  32. package/dist-esm/plugin/billboardjs-plugin-tableview.js +2 -2
  33. package/dist-esm/plugin/billboardjs-plugin-textoverlap.js +2 -2
  34. package/package.json +13 -13
  35. package/src/Chart/api/data.ts +2 -2
  36. package/src/Chart/api/grid.x.ts +2 -2
  37. package/src/Chart/api/grid.y.ts +4 -2
  38. package/src/Chart/api/regions.ts +2 -2
  39. package/src/Chart/api/tooltip.ts +2 -2
  40. package/src/ChartInternal/data/data.ts +4 -2
  41. package/src/ChartInternal/internals/text.ts +14 -4
  42. package/src/ChartInternal/shape/bar.ts +9 -4
  43. package/types/chart.d.ts +4 -4
  44. package/types/options.d.ts +1 -1
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */
10
10
  /*-- Datalab Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */.bb-color-pattern{background-image:url(#2ac4b3;#feaf29;#ff617b;#73a2ef;#b180d0;#3064cf;#d0a45f;#8aaec7;#ef65a2;#8aaec7;)}.bb svg{font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;font-size:11px;line-height:1}.bb line,.bb path{fill:none;stroke:#000}.bb .bb-button,.bb text{-webkit-font-smoothing:antialiased;fill:#555;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis{stroke-width:.7px}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:.7px}.bb-circle{fill:#fff!important}.bb-circle._expanded_{stroke-width:2px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:1px}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item line.bb-legend-item-tile{stroke-linecap:round;stroke-width:8px;stroke-dasharray:1 20;transform:translate(7px,1px)}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#000;stroke-width:1px}.bb-tooltip-container{font-family:Sans Pro,Arial,sans-serif,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{-webkit-font-smoothing:antialiased;background-color:#fff;border:1px solid #999;border-collapse:separate;border-radius:2px;border-spacing:0;empty-cells:show;font-size:11px;text-align:left}.bb-tooltip th{background-color:#0b00b1;border-bottom:2px solid #ff2d2d;color:#fffdfd;font-size:13px;padding:2px 8px;text-align:left}.bb-tooltip td{padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{border:1px solid #000;border-radius:3px;display:inline-block;height:8px;margin-right:6px;vertical-align:middle;width:8px}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-size:11px;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:11px;font-weight:800;padding-left:5px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:18px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{fill:#000;font-size:18px!important;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#3b6969}.bb-chart-arc path{stroke:#000;stroke-width:.5px}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:14px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:.7px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;padding:5px}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */
10
10
  /*-- Graph Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */.bb-color-pattern{background-image:url(#65CFC2;#D0A45F;#64A4F5;#EF65A2;#A377FE;#8AAEC7;#FF7E5A;#898EFE;#FFAC35;#70B0FF;)}.bb svg{font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;font-size:12px;line-height:1}.bb line,.bb path{fill:none;stroke:#8c8c8c}.bb .bb-button,.bb text{fill:#555;font-size:12px;letter-spacing:-.3px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-axis-y text,.bb-axis-y2 text{fill:#8c8c8c}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ffb6b6;stroke-dasharray:3px}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_,rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:2px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1px;opacity:.75}.bb-legend-item line{stroke-dasharray:1px}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{font-family:Helvetica,Apple SD Gothic Neo,Arial,sans-serif,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border:1px solid #999;border-collapse:separate;border-radius:2px;border-spacing:0;box-shadow:.5px .5px 1px #999;empty-cells:show;font-size:12px;text-align:left;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-tooltip th{background-color:#efefef;border-bottom:1px dotted #000;color:#000;font-size:12px;padding:4px 8px;text-align:center}.bb-tooltip tr:last-child td{border-bottom:none}.bb-tooltip td{background-color:#fff;border-bottom:1px solid #eee;padding:3px 6px}.bb-tooltip td:first-child{border-right:1px solid #eee;padding-left:5px}.bb-tooltip td:last-child{padding-right:5px}.bb-tooltip td>span,.bb-tooltip td>svg{display:inline-block;height:12px;margin-right:6px;vertical-align:middle;width:5px}.bb-tooltip td.value{border-left:1px solid transparent;text-align:right}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:1px;font-size:12px}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-weight:800;padding-left:5px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:#fff}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{fill:#8c8c8c;font-size:16px!important;font-style:italic}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#8c8c8c;font-style:italic}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px;font-weight:700}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#8c8c8c}.bb-chart-radars .bb-axis line{stroke:#8c8c8c;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em;font-weight:700}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;box-shadow:1px 1px 2px #ccc;cursor:pointer;opacity:.8;padding:5px}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */
10
10
  /*-- Insight Theme --*/
11
11
  /*-- Default color pattern --*/
@@ -5,5 +5,5 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */.bb-color-pattern{background-image:url(#00c73c;#fa7171;#2ad0ff;#7294ce;#e3e448;#cc7e6e;#fb6ccf;#c98dff;#4aea99;#bbbbbb;)}.bb svg{font-family:sans-serif,Arial,nanumgothic,Dotum;font-size:12px;line-height:1}.bb line,.bb path{fill:none;stroke:#c4c4c4}.bb .bb-button,.bb text{fill:#555;font-size:11px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.bb-axis,.bb-bars path,.bb-event-rect,.bb-legend-item-title,.bb-xgrid-focus,.bb-ygrid,.bb-ygrid-focus{shape-rendering:crispEdges}.bb-axis-y text,.bb-axis-y2 text{fill:#737373}.bb-event-rects{fill-opacity:1!important}.bb-event-rects .bb-event-rect{fill:transparent}.bb-event-rects .bb-event-rect._active_{fill:rgba(39,201,3,.05)}.tick._active_ text{fill:#00c83c!important}.bb-grid{pointer-events:none}.bb-grid line{stroke:#f1f1f1}.bb-xgrid-focus line,.bb-ygrid-focus line{stroke:#ddd}.bb-text.bb-empty{fill:#767676}.bb-line{stroke-width:1px}.bb-circle._expanded_{fill:#fff!important;stroke-width:2px;stroke:red}rect.bb-circle._expanded_,use.bb-circle._expanded_{stroke-width:1px}.bb-selected-circle{fill:#fff;stroke-width:2px}.bb-bar{stroke-width:0}.bb-bar._expanded_{fill-opacity:.75}.bb-candlestick{stroke-width:1px}.bb-candlestick._expanded_{fill-opacity:.75}.bb-circles.bb-focused,.bb-target.bb-focused{opacity:1}.bb-circles.bb-focused path.bb-line,.bb-circles.bb-focused path.bb-step,.bb-target.bb-focused path.bb-line,.bb-target.bb-focused path.bb-step{stroke-width:2px}.bb-circles.bb-defocused,.bb-target.bb-defocused{opacity:.3!important}.bb-circles.bb-defocused .text-overlapping,.bb-target.bb-defocused .text-overlapping{opacity:.05!important}.bb-region{fill:#4682b4;fill-opacity:.1}.bb-region.selected rect{fill:#27c903}.bb-brush .extent,.bb-zoom-brush{fill-opacity:.1}.bb-legend-item{user-select:none}.bb-legend-item-hidden{opacity:.15}.bb-legend-background{fill:#fff;stroke:#d3d3d3;stroke-width:1;opacity:.75}.bb-title{font-size:14px}.bb-chart-treemaps rect{stroke:#fff;stroke-width:1px}.bb-tooltip-container{font-family:sans-serif,Arial,nanumgothic,Dotum;user-select:none;z-index:10}.bb-tooltip{background-color:#fff;border:1px solid #999;border-collapse:separate;border-spacing:0;empty-cells:show;font-size:11px;text-align:left}.bb-tooltip th{border-bottom:1px solid #eee;font-size:12px;padding:4px 8px;text-align:left}.bb-tooltip td{background-color:#fff;padding:4px 6px}.bb-tooltip td:first-child{padding-left:8px}.bb-tooltip td:last-child{padding-right:8px}.bb-tooltip td>span,.bb-tooltip td>svg{border-radius:5px;display:inline-block;height:10px;margin-right:6px;vertical-align:middle;width:10px}.bb-tooltip td.value{border-left:1px solid transparent}.bb-tooltip .bb-tooltip-title{color:#aaa;display:inline-block;line-height:20px}.bb-tooltip .bb-tooltip-detail table{border-collapse:collapse;border-spacing:0}.bb-tooltip .bb-tooltip-detail .bb-tooltip-name,.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{color:#444;font-size:11px;font-weight:400;line-height:13px;padding:4px 0 3px;text-align:left}.bb-tooltip .bb-tooltip-detail .bb-tooltip-value{font-size:12px;font-weight:800;padding-left:5px}.bb-area{stroke-width:0;opacity:.2}.bb-chart-arcs-title{dominant-baseline:middle;font-size:1.3em}text.bb-chart-arcs-gauge-title{dominant-baseline:middle;font-size:2.7em}.bb-chart-arcs .bb-chart-arcs-background{fill:#e0e0e0;stroke:none}.bb-chart-arcs .bb-chart-arcs-gauge-unit{fill:#000;font-size:16px}.bb-chart-arcs .bb-chart-arcs-gauge-max,.bb-chart-arcs .bb-chart-arcs-gauge-min{fill:#777}.bb-chart-arcs .bb-chart-arcs-title{fill:#000;font-size:16px!important;font-weight:600}.bb-chart-arcs path.empty{fill:#eaeaea;stroke-width:0}.bb-chart-arcs .bb-levels circle{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-arcs .bb-levels text{fill:#848282}.bb-chart-arc .bb-gauge-value{fill:#000}.bb-chart-arc path{stroke:#fff}.bb-chart-arc rect{stroke:#fff;stroke-width:1}.bb-chart-arc text{fill:#fff;font-size:13px}.bb-chart-radars .bb-levels polygon{fill:none;stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-levels text{fill:#848282}.bb-chart-radars .bb-axis line{stroke:#848282;stroke-width:.5px}.bb-chart-radars .bb-axis text{cursor:default;font-size:1.15em}.bb-chart-radars .bb-shapes polygon{fill-opacity:.2;stroke-width:1px}.bb-button{position:absolute;right:10px;top:10px}.bb-button .bb-zoom-reset{background-color:#fff;border:1px solid #ccc;border-radius:5px;cursor:pointer;padding:5px}
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  */
10
10
  import { timeParse, utcParse, timeFormat, utcFormat } from 'd3-time-format';
11
11
  import { pointer, select, namespaces, selectAll } from 'd3-selection';
@@ -4437,8 +4437,9 @@ var data$1 = {
4437
4437
  total = total.map(function (v, i) { return v - hiddenSum_1[i]; });
4438
4438
  }
4439
4439
  }
4440
- d.ratio = isNumber(d.value) && total ?
4441
- d.value / total[d.index] : 0;
4440
+ var divisor = total[d.index];
4441
+ d.ratio = isNumber(d.value) && total && divisor ?
4442
+ d.value / divisor : 0;
4442
4443
  ratio = d.ratio;
4443
4444
  }
4444
4445
  else if (type === "radar") {
@@ -7618,7 +7619,7 @@ var text = {
7618
7619
  */
7619
7620
  updateText: function () {
7620
7621
  var $$ = this;
7621
- var $el = $$.$el, $T = $$.$T, config = $$.config;
7622
+ var $el = $$.$el, $T = $$.$T, config = $$.config, axis = $$.axis;
7622
7623
  var classText = $$.getClass("text", "index");
7623
7624
  var labelsCentered = config.data_labels.centered;
7624
7625
  var text = $el.main.selectAll(".".concat($TEXT.texts))
@@ -7632,8 +7633,9 @@ var text = {
7632
7633
  .merge(text)
7633
7634
  .attr("class", classText)
7634
7635
  .attr("text-anchor", function (d) {
7636
+ var isInverted = config["axis_".concat(axis === null || axis === void 0 ? void 0 : axis.getId(d.id), "_inverted")];
7635
7637
  // when value is negative or
7636
- var isEndAnchor = d.value < 0;
7638
+ var isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
7637
7639
  if ($$.isCandlestickType(d)) {
7638
7640
  var data = $$.getCandlestickData(d);
7639
7641
  isEndAnchor = !(data === null || data === void 0 ? void 0 : data._isUp);
@@ -7896,8 +7898,16 @@ var text = {
7896
7898
  }
7897
7899
  else {
7898
7900
  if (isRotated) {
7901
+ var isInverted = config["axis_".concat($$.axis.getId(d.id), "_inverted")];
7899
7902
  var padding = $$.isBarType(d) ? 4 : 6;
7900
- xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
7903
+ var value = d.value;
7904
+ xPos = points[2][1];
7905
+ if (isInverted) {
7906
+ xPos -= padding * (value > 0 ? 1 : -1);
7907
+ }
7908
+ else {
7909
+ xPos += padding * (value < 0 ? -1 : 1);
7910
+ }
7901
7911
  }
7902
7912
  else {
7903
7913
  xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
@@ -9747,14 +9757,14 @@ var apiColor = {
9747
9757
  * // Get all data
9748
9758
  * chart.data();
9749
9759
  */
9750
- function data(targetIds) {
9760
+ var data = function (targetIds) {
9751
9761
  var targets = this.internal.data.targets;
9752
9762
  if (!isUndefined(targetIds)) {
9753
9763
  var ids_1 = isArray(targetIds) ? targetIds : [targetIds];
9754
9764
  return targets.filter(function (t) { return ids_1.some(function (v) { return v === t.id; }); });
9755
9765
  }
9756
9766
  return targets;
9757
- }
9767
+ };
9758
9768
  extend(data, {
9759
9769
  /**
9760
9770
  * Get data shown in the chart.
@@ -10761,7 +10771,7 @@ var tooltip = {
10761
10771
  * @memberof Chart
10762
10772
  */
10763
10773
  hide: function () {
10764
- var _a;
10774
+ var _a, _b, _c;
10765
10775
  var $$ = this.internal;
10766
10776
  var inputType = $$.state.inputType, tooltip = $$.$el.tooltip;
10767
10777
  var data = tooltip === null || tooltip === void 0 ? void 0 : tooltip.datum();
@@ -10776,9 +10786,9 @@ var tooltip = {
10776
10786
  // reset last touch point index
10777
10787
  inputType === "touch" && $$.callOverOutForTouch();
10778
10788
  $$.hideTooltip(true);
10779
- $$.hideGridFocus();
10780
- (_a = $$.unexpandCircles) === null || _a === void 0 ? void 0 : _a.call($$);
10781
- $$.expandBarTypeShapes(false);
10789
+ (_a = $$.hideGridFocus) === null || _a === void 0 ? void 0 : _a.call($$);
10790
+ (_b = $$.unexpandCircles) === null || _b === void 0 ? void 0 : _b.call($$);
10791
+ (_c = $$.expandBarTypeShapes) === null || _c === void 0 ? void 0 : _c.call($$, false);
10782
10792
  }
10783
10793
  };
10784
10794
  var apiTooltip = { tooltip: tooltip };
@@ -11187,7 +11197,7 @@ var apiCategory = {
11187
11197
  * ]);
11188
11198
  * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
11189
11199
  */
11190
- function xgrids(grids) {
11200
+ var xgrids = function (grids) {
11191
11201
  var $$ = this.internal;
11192
11202
  var config = $$.config;
11193
11203
  if (!grids) {
@@ -11196,7 +11206,7 @@ function xgrids(grids) {
11196
11206
  config.grid_x_lines = grids;
11197
11207
  $$.redrawWithoutRescale();
11198
11208
  return config.grid_x_lines;
11199
- }
11209
+ };
11200
11210
  extend(xgrids, {
11201
11211
  /**
11202
11212
  * Add x grid lines.<br>
@@ -11266,7 +11276,7 @@ var apiXGrid = { xgrids: xgrids };
11266
11276
  * ]);
11267
11277
  * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
11268
11278
  */
11269
- function ygrids(grids) {
11279
+ var ygrids = function (grids) {
11270
11280
  var $$ = this.internal;
11271
11281
  var config = $$.config;
11272
11282
  if (!grids) {
@@ -11275,7 +11285,7 @@ function ygrids(grids) {
11275
11285
  config.grid_y_lines = grids;
11276
11286
  $$.redrawWithoutRescale();
11277
11287
  return config.grid_y_lines;
11278
- }
11288
+ };
11279
11289
  extend(ygrids, {
11280
11290
  /**
11281
11291
  * Add y grid lines.<br>
@@ -11376,7 +11386,7 @@ var apiGroup = {
11376
11386
  * {axis: "y", end: 50, class: "regionY"}
11377
11387
  * ]);
11378
11388
  */
11379
- function regions(regions) {
11389
+ var regions = function (regions) {
11380
11390
  var $$ = this.internal;
11381
11391
  var config = $$.config;
11382
11392
  if (!regions) {
@@ -11385,7 +11395,7 @@ function regions(regions) {
11385
11395
  config.regions = regions;
11386
11396
  $$.redrawWithoutRescale();
11387
11397
  return regions;
11388
- }
11398
+ };
11389
11399
  extend(regions, {
11390
11400
  /**
11391
11401
  * Add new region.<br><br>
@@ -17455,7 +17465,9 @@ var shapeBar = {
17455
17465
  // switch points if axis is rotated, not applicable for sub chart
17456
17466
  var indexX = +isRotated;
17457
17467
  var indexY = +!indexX;
17458
- var isNegative = d.value < 0;
17468
+ var isUnderZero = d.value < 0;
17469
+ var isInverted = config["axis_".concat($$.axis.getId(d.id), "_inverted")];
17470
+ var isNegative = (!isInverted && isUnderZero) || (isInverted && !isUnderZero);
17459
17471
  var pathRadius = ["", ""];
17460
17472
  var radius = 0;
17461
17473
  var isGrouped = $$.isGrouped(d.id);
@@ -17473,7 +17485,7 @@ var shapeBar = {
17473
17485
  // path string data shouldn't be containing new line chars
17474
17486
  // https://github.com/naver/billboard.js/issues/530
17475
17487
  var path = isRotated ?
17476
- "H".concat(points[1][indexX] - radius, " ").concat(pathRadius[0], "V").concat(points[2][indexY] - radius, " ").concat(pathRadius[1], "H").concat(points[3][indexX]) :
17488
+ "H".concat(points[1][indexX] + (isNegative ? radius : -radius), " ").concat(pathRadius[0], "V").concat(points[2][indexY] - radius, " ").concat(pathRadius[1], "H").concat(points[3][indexX]) :
17477
17489
  "V".concat(points[1][indexY] + (isNegative ? -radius : radius), " ").concat(pathRadius[0], "H").concat(points[2][indexX] - radius, " ").concat(pathRadius[1], "V").concat(points[3][indexY]);
17478
17490
  return "M".concat(points[0][indexX], ",").concat(points[0][indexY]).concat(path, "z");
17479
17491
  };
@@ -17522,14 +17534,16 @@ var shapeBar = {
17522
17534
  var barOffset = $$.getShapeOffset($$.isBarType, barIndices, !!isSub);
17523
17535
  var yScale = $$.getYScaleById.bind($$);
17524
17536
  return function (d, i) {
17525
- var y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
17537
+ var id = d.id;
17538
+ var y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id));
17526
17539
  var offset = barOffset(d, i) || y0; // offset is for stacked bar chart
17527
17540
  var width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
17541
+ var isInverted = config["axis_".concat($$.axis.getId(id), "_inverted")];
17528
17542
  var value = d.value;
17529
17543
  var posX = barX(d);
17530
17544
  var posY = barY(d);
17531
17545
  // fix posY not to overflow opposite quadrant
17532
- if (config.axis_rotated && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {
17546
+ if (config.axis_rotated && !isInverted && ((value > 0 && posY < y0) || (value < 0 && y0 < posY))) {
17533
17547
  posY = y0;
17534
17548
  }
17535
17549
  if (!$$.isBarRangeType(d)) {
@@ -22100,7 +22114,7 @@ var zoomModule = function () {
22100
22114
  var defaults = {};
22101
22115
  /**
22102
22116
  * @namespace bb
22103
- * @version 3.7.1
22117
+ * @version 3.7.3
22104
22118
  */
22105
22119
  var bb = {
22106
22120
  /**
@@ -22110,7 +22124,7 @@ var bb = {
22110
22124
  * bb.version; // "1.0.0"
22111
22125
  * @memberof bb
22112
22126
  */
22113
- version: "3.7.1",
22127
+ version: "3.7.3",
22114
22128
  /**
22115
22129
  * Generate chart
22116
22130
  * - **NOTE:** Bear in mind for the possiblity of ***throwing an error***, during the generation when:
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -104,7 +104,7 @@ var Plugin = /** @class */ (function () {
104
104
  delete _this[key];
105
105
  });
106
106
  };
107
- Plugin.version = "3.7.1";
107
+ Plugin.version = "3.7.3";
108
108
  return Plugin;
109
109
  }());
110
110
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -278,7 +278,7 @@ var Plugin = /** @class */ (function () {
278
278
  delete _this[key];
279
279
  });
280
280
  };
281
- Plugin.version = "3.7.1";
281
+ Plugin.version = "3.7.3";
282
282
  return Plugin;
283
283
  }());
284
284
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -486,7 +486,7 @@ var Plugin = /** @class */ (function () {
486
486
  delete _this[key];
487
487
  });
488
488
  };
489
- Plugin.version = "3.7.1";
489
+ Plugin.version = "3.7.3";
490
490
  return Plugin;
491
491
  }());
492
492
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -121,7 +121,7 @@ var Plugin = /** @class */ (function () {
121
121
  delete _this[key];
122
122
  });
123
123
  };
124
- Plugin.version = "3.7.1";
124
+ Plugin.version = "3.7.3";
125
125
  return Plugin;
126
126
  }());
127
127
  var Plugin$1 = Plugin;
@@ -5,7 +5,7 @@
5
5
  * billboard.js, JavaScript chart library
6
6
  * https://naver.github.io/billboard.js/
7
7
  *
8
- * @version 3.7.1
8
+ * @version 3.7.3
9
9
  * @requires billboard.js
10
10
  * @summary billboard.js plugin
11
11
  */
@@ -263,7 +263,7 @@ var Plugin = /** @class */ (function () {
263
263
  delete _this[key];
264
264
  });
265
265
  };
266
- Plugin.version = "3.7.1";
266
+ Plugin.version = "3.7.3";
267
267
  return Plugin;
268
268
  }());
269
269
  var Plugin$1 = Plugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "billboard.js",
3
- "version": "3.7.1",
3
+ "version": "3.7.3",
4
4
  "description": "Re-usable easy interface JavaScript chart library, based on D3 v4+",
5
5
  "homepage": "https://naver.github.io/billboard.js/",
6
6
  "main": "dist/billboard.js",
@@ -108,9 +108,9 @@
108
108
  "@babel/plugin-transform-runtime": "^7.19.1",
109
109
  "@babel/preset-env": "^7.20.2",
110
110
  "@babel/preset-typescript": "^7.18.6",
111
- "@babel/runtime": "^7.20.7",
112
- "@commitlint/cli": "17.4.1",
113
- "@commitlint/config-conventional": "^17.4.0",
111
+ "@babel/runtime": "^7.20.13",
112
+ "@commitlint/cli": "17.4.2",
113
+ "@commitlint/config-conventional": "^17.4.2",
114
114
  "@rollup/plugin-babel": "^6.0.3",
115
115
  "@rollup/plugin-node-resolve": "^15.0.0",
116
116
  "@rollup/plugin-replace": "^5.0.2",
@@ -119,14 +119,14 @@
119
119
  "@semantic-release/commit-analyzer": "^9.0.2",
120
120
  "@semantic-release/exec": "^6.0.3",
121
121
  "@semantic-release/git": "^10.0.1",
122
- "@semantic-release/npm": "^9.0.1",
122
+ "@semantic-release/npm": "^9.0.2",
123
123
  "@semantic-release/release-notes-generator": "^10.0.3",
124
124
  "@types/chai": "^4.3.4",
125
125
  "@types/d3": "^7.4.0",
126
126
  "@types/mocha": "^10.0.1",
127
127
  "@types/sinon": "^10.0.13",
128
- "@typescript-eslint/eslint-plugin": "^5.48.1",
129
- "@typescript-eslint/parser": "^5.48.1",
128
+ "@typescript-eslint/eslint-plugin": "^5.49.0",
129
+ "@typescript-eslint/parser": "^5.49.0",
130
130
  "babel-helper-modules": "^6.0.0",
131
131
  "babel-loader": "^9.1.2",
132
132
  "babel-plugin-add-module-exports": "^1.0.4",
@@ -142,7 +142,7 @@
142
142
  "chai": "^4.3.7",
143
143
  "clean-webpack-plugin": "^4.0.0",
144
144
  "cloc": "^2.11.0",
145
- "core-js": "^3.27.1",
145
+ "core-js": "^3.27.2",
146
146
  "coveralls": "^3.1.1",
147
147
  "cross-env": "^7.0.3",
148
148
  "css-loader": "^6.7.3",
@@ -153,10 +153,10 @@
153
153
  "d3-polygon": "^3.0.1",
154
154
  "docdash": "^2.0.1",
155
155
  "dtslint": "^4.2.1",
156
- "eslint": "^8.31.0",
156
+ "eslint": "^8.32.0",
157
157
  "eslint-config-naver": "^2.1.0",
158
- "eslint-plugin-import": "^2.26.0",
159
- "eslint-plugin-jsdoc": "^39.6.4",
158
+ "eslint-plugin-import": "^2.27.5",
159
+ "eslint-plugin-jsdoc": "^39.6.8",
160
160
  "eslint-webpack-plugin": "^3.2.0",
161
161
  "exports-loader": "^4.0.0",
162
162
  "hammer-simulator": "0.0.1",
@@ -180,10 +180,10 @@
180
180
  "mocha": "^10.2.0",
181
181
  "node-sass": "^8.0.0",
182
182
  "regenerator-runtime": "^0.13.11",
183
- "rollup": "^3.9.1",
183
+ "rollup": "^3.10.1",
184
184
  "rollup-plugin-delete": "^2.0.0",
185
185
  "sass-loader": "^13.2.0",
186
- "semantic-release": "^20.0.2",
186
+ "semantic-release": "^20.0.4",
187
187
  "simulant": "^0.2.2",
188
188
  "sinon": "^15.0.1",
189
189
  "string-replace-loader": "^3.1.0",
@@ -24,7 +24,7 @@ import type {IDataRow} from "../../ChartInternal/data/IData";
24
24
  * // Get all data
25
25
  * chart.data();
26
26
  */
27
- function data(targetIds: string|string[]): DataItem[] {
27
+ const data = function(targetIds: string|string[]): DataItem[] {
28
28
  const {targets} = this.internal.data;
29
29
 
30
30
  if (!isUndefined(targetIds)) {
@@ -34,7 +34,7 @@ function data(targetIds: string|string[]): DataItem[] {
34
34
  }
35
35
 
36
36
  return targets;
37
- }
37
+ };
38
38
 
39
39
  extend(data, {
40
40
  /**
@@ -21,7 +21,7 @@ type GridsParam = {value?: number, class?: string, text?: string}[];
21
21
  * ]);
22
22
  * // --> Returns: [{value: 1, text: "Label 1"}, {value: 4, text: "Label 4"}]
23
23
  */
24
- function xgrids(grids: GridsParam): GridsParam {
24
+ const xgrids = function(grids: GridsParam): GridsParam {
25
25
  const $$ = this.internal;
26
26
  const {config} = $$;
27
27
 
@@ -33,7 +33,7 @@ function xgrids(grids: GridsParam): GridsParam {
33
33
  $$.redrawWithoutRescale();
34
34
 
35
35
  return config.grid_x_lines;
36
- }
36
+ };
37
37
 
38
38
  extend(xgrids, {
39
39
  /**
@@ -19,7 +19,9 @@ import {extend} from "../../module/util";
19
19
  * ]);
20
20
  * // --> Returns: [{value: 100, text: "Label 1"}, {value: 400, text: "Label 4"}]
21
21
  */
22
- function ygrids(grids: {value?: number, text?: string}[]): {value?: number, text?: string}[] {
22
+ const ygrids = function(grids: {value?: number, text?: string}[]): {
23
+ value?: number, text?: string
24
+ }[] {
23
25
  const $$ = this.internal;
24
26
  const {config} = $$;
25
27
 
@@ -31,7 +33,7 @@ function ygrids(grids: {value?: number, text?: string}[]): {value?: number, text
31
33
  $$.redrawWithoutRescale();
32
34
 
33
35
  return config.grid_y_lines;
34
- }
36
+ };
35
37
 
36
38
  extend(ygrids, {
37
39
  /**
@@ -21,7 +21,7 @@ type RegionsParam = {axis?: string, class?: string, start?: number, end?: number
21
21
  * {axis: "y", end: 50, class: "regionY"}
22
22
  * ]);
23
23
  */
24
- function regions(regions: RegionsParam): RegionsParam {
24
+ const regions = function(regions: RegionsParam): RegionsParam {
25
25
  const $$ = this.internal;
26
26
  const {config} = $$;
27
27
 
@@ -33,7 +33,7 @@ function regions(regions: RegionsParam): RegionsParam {
33
33
  $$.redrawWithoutRescale();
34
34
 
35
35
  return regions;
36
- }
36
+ };
37
37
 
38
38
  extend(regions, {
39
39
  /**
@@ -133,10 +133,10 @@ const tooltip = {
133
133
  inputType === "touch" && $$.callOverOutForTouch();
134
134
 
135
135
  $$.hideTooltip(true);
136
- $$.hideGridFocus();
136
+ $$.hideGridFocus?.();
137
137
 
138
138
  $$.unexpandCircles?.();
139
- $$.expandBarTypeShapes(false);
139
+ $$.expandBarTypeShapes?.(false);
140
140
  }
141
141
  };
142
142
 
@@ -946,8 +946,10 @@ export default {
946
946
  }
947
947
  }
948
948
 
949
- d.ratio = isNumber(d.value) && total ?
950
- d.value / total[d.index] : 0;
949
+ const divisor = total[d.index];
950
+
951
+ d.ratio = isNumber(d.value) && total && divisor ?
952
+ d.value / divisor : 0;
951
953
 
952
954
  ratio = d.ratio;
953
955
  } else if (type === "radar") {
@@ -141,7 +141,7 @@ export default {
141
141
  */
142
142
  updateText(): void {
143
143
  const $$ = this;
144
- const {$el, $T, config} = $$;
144
+ const {$el, $T, config, axis} = $$;
145
145
  const classText = $$.getClass("text", "index");
146
146
  const labelsCentered = config.data_labels.centered;
147
147
 
@@ -158,8 +158,10 @@ export default {
158
158
  .merge(text)
159
159
  .attr("class", classText)
160
160
  .attr("text-anchor", d => {
161
+ const isInverted = config[`axis_${axis?.getId(d.id)}_inverted`];
162
+
161
163
  // when value is negative or
162
- let isEndAnchor = d.value < 0;
164
+ let isEndAnchor = isInverted ? d.value > 0 : d.value < 0;
163
165
 
164
166
  if ($$.isCandlestickType(d)) {
165
167
  const data = $$.getCandlestickData(d);
@@ -443,7 +445,7 @@ export default {
443
445
  * @returns {number} x coordinate
444
446
  * @private
445
447
  */
446
- getXForText(points, d, textElement): number {
448
+ getXForText(points, d: IDataRow, textElement): number {
447
449
  const $$ = this;
448
450
  const {config, state} = $$;
449
451
  const isRotated = config.axis_rotated;
@@ -461,9 +463,17 @@ export default {
461
463
  xPos += config.data_labels.centered ? 0 : 5;
462
464
  } else {
463
465
  if (isRotated) {
466
+ const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
464
467
  const padding = $$.isBarType(d) ? 4 : 6;
468
+ const value = d.value as number;
469
+
470
+ xPos = points[2][1];
465
471
 
466
- xPos = points[2][1] + padding * (d.value < 0 ? -1 : 1);
472
+ if (isInverted) {
473
+ xPos -= padding * (value > 0 ? 1 : -1);
474
+ } else {
475
+ xPos += padding * (value < 0 ? -1 : 1);
476
+ }
467
477
  } else {
468
478
  xPos = $$.hasType("bar") ? (points[2][0] + points[0][0]) / 2 : xPos;
469
479
  }
@@ -172,7 +172,10 @@ export default {
172
172
  const indexX = +isRotated;
173
173
  const indexY = +!indexX;
174
174
 
175
- const isNegative = d.value as number < 0;
175
+ const isUnderZero = d.value as number < 0;
176
+ const isInverted = config[`axis_${$$.axis.getId(d.id)}_inverted`];
177
+ const isNegative = (!isInverted && isUnderZero) || (isInverted && !isUnderZero);
178
+
176
179
  const pathRadius = ["", ""];
177
180
  let radius = 0;
178
181
 
@@ -197,7 +200,7 @@ export default {
197
200
  // path string data shouldn't be containing new line chars
198
201
  // https://github.com/naver/billboard.js/issues/530
199
202
  const path = isRotated ?
200
- `H${points[1][indexX] - radius} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` :
203
+ `H${points[1][indexX] + (isNegative ? radius : -radius)} ${pathRadius[0]}V${points[2][indexY] - radius} ${pathRadius[1]}H${points[3][indexX]}` :
201
204
  `V${points[1][indexY] + (isNegative ? -radius : radius)} ${pathRadius[0]}H${points[2][indexX] - radius} ${pathRadius[1]}V${points[3][indexY]}`;
202
205
 
203
206
  return `M${points[0][indexX]},${points[0][indexY]}${path}z`;
@@ -262,15 +265,17 @@ export default {
262
265
  const yScale = $$.getYScaleById.bind($$);
263
266
 
264
267
  return (d: IDataRow, i: number) => {
265
- const y0 = yScale.call($$, d.id, isSub)($$.getShapeYMin(d.id));
268
+ const {id} = d;
269
+ const y0 = yScale.call($$, id, isSub)($$.getShapeYMin(id));
266
270
  const offset = barOffset(d, i) || y0; // offset is for stacked bar chart
267
271
  const width = isNumber(barW) ? barW : barW[d.id] || barW._$width;
272
+ const isInverted = config[`axis_${$$.axis.getId(id)}_inverted`];
268
273
  const value = d.value as number;
269
274
  const posX = barX(d);
270
275
  let posY = barY(d);
271
276
 
272
277
  // fix posY not to overflow opposite quadrant
273
- if (config.axis_rotated && (
278
+ if (config.axis_rotated && !isInverted && (
274
279
  (value > 0 && posY < y0) || (value < 0 && y0 < posY)
275
280
  )) {
276
281
  posY = y0;