@amcharts/amcharts5 5.1.9 → 5.1.10

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 (191) hide show
  1. package/.internal/charts/radar/RadarChart.d.ts.map +1 -1
  2. package/.internal/charts/radar/RadarChart.js +0 -2
  3. package/.internal/charts/radar/RadarChart.js.map +1 -1
  4. package/.internal/charts/xy/XYChart.d.ts.map +1 -1
  5. package/.internal/charts/xy/XYChart.js +7 -0
  6. package/.internal/charts/xy/XYChart.js.map +1 -1
  7. package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
  8. package/.internal/charts/xy/XYChartDefaultTheme.js +0 -2
  9. package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
  10. package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
  11. package/.internal/charts/xy/axes/AxisRendererX.js +1 -0
  12. package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
  13. package/.internal/charts/xy/axes/ValueAxis.d.ts +1 -0
  14. package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
  15. package/.internal/charts/xy/axes/ValueAxis.js +109 -71
  16. package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
  17. package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
  18. package/.internal/charts/xy/series/BaseColumnSeries.js +9 -0
  19. package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
  20. package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
  21. package/.internal/charts/xy/series/XYSeries.js +6 -0
  22. package/.internal/charts/xy/series/XYSeries.js.map +1 -1
  23. package/.internal/core/Root.d.ts.map +1 -1
  24. package/.internal/core/Root.js +1 -0
  25. package/.internal/core/Root.js.map +1 -1
  26. package/.internal/core/render/Legend.d.ts.map +1 -1
  27. package/.internal/core/render/Legend.js +7 -0
  28. package/.internal/core/render/Legend.js.map +1 -1
  29. package/.internal/core/render/Series.d.ts.map +1 -1
  30. package/.internal/core/render/Series.js +11 -7
  31. package/.internal/core/render/Series.js.map +1 -1
  32. package/.internal/core/render/backend/CanvasRenderer.d.ts +1 -0
  33. package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
  34. package/.internal/core/render/backend/CanvasRenderer.js +17 -1
  35. package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
  36. package/.internal/core/render/backend/Renderer.d.ts +1 -0
  37. package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
  38. package/.internal/core/render/backend/Renderer.js.map +1 -1
  39. package/.internal/core/util/PopulateString.js +12 -2
  40. package/.internal/core/util/PopulateString.js.map +1 -1
  41. package/.internal/plugins/json/Classes-script.d.ts +271 -0
  42. package/.internal/plugins/json/Classes-script.d.ts.map +1 -0
  43. package/.internal/plugins/json/Classes-script.js +139 -0
  44. package/.internal/plugins/json/Classes-script.js.map +1 -0
  45. package/.internal/plugins/json/Classes.d.ts +262 -262
  46. package/.internal/plugins/json/Classes.d.ts.map +1 -1
  47. package/.internal/plugins/json/Classes.js +131 -262
  48. package/.internal/plugins/json/Classes.js.map +1 -1
  49. package/.internal/plugins/json/Json.d.ts +3 -3
  50. package/.internal/plugins/json/Json.d.ts.map +1 -1
  51. package/.internal/plugins/json/Json.js +239 -34
  52. package/.internal/plugins/json/Json.js.map +1 -1
  53. package/CHANGELOG.md +19 -0
  54. package/examples/javascript/flow-chord/package.json +1 -1
  55. package/examples/javascript/flow-chord-directed/package.json +1 -1
  56. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  57. package/examples/javascript/flow-sankey/package.json +1 -1
  58. package/examples/javascript/gauge/package.json +1 -1
  59. package/examples/javascript/gauge-bands/package.json +1 -1
  60. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  61. package/examples/javascript/hierarchy-pack/package.json +1 -1
  62. package/examples/javascript/hierarchy-partition/package.json +1 -1
  63. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  64. package/examples/javascript/hierarchy-tree/package.json +1 -1
  65. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  66. package/examples/javascript/json/README.md +6 -0
  67. package/examples/javascript/json/index.css +11 -0
  68. package/examples/javascript/json/index.html +12 -0
  69. package/examples/javascript/json/index.js +94 -0
  70. package/examples/javascript/json/package.json +16 -0
  71. package/examples/javascript/json/webpack.config.js +38 -0
  72. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  73. package/examples/javascript/map-day-and-night/package.json +1 -1
  74. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  75. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  76. package/examples/javascript/map-with-bubbles/package.json +1 -1
  77. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  78. package/examples/javascript/misc-40-charts/package.json +1 -1
  79. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  80. package/examples/javascript/pie-chart/package.json +1 -1
  81. package/examples/javascript/pie-donut-chart/package.json +1 -1
  82. package/examples/javascript/pie-variable-radius/package.json +1 -1
  83. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  84. package/examples/javascript/radar-heat-map/package.json +1 -1
  85. package/examples/javascript/radar-line/package.json +1 -1
  86. package/examples/javascript/radar-time-line/package.json +1 -1
  87. package/examples/javascript/sliced-funnel/package.json +1 -1
  88. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  89. package/examples/javascript/sliced-pyramid/package.json +1 -1
  90. package/examples/javascript/venn-diagram/package.json +1 -1
  91. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  92. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  93. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  94. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  95. package/examples/javascript/xy-bubble/package.json +1 -1
  96. package/examples/javascript/xy-candlestick/package.json +1 -1
  97. package/examples/javascript/xy-clustered-column/package.json +1 -1
  98. package/examples/javascript/xy-column/package.json +1 -1
  99. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  100. package/examples/javascript/xy-data-grouping/package.json +1 -1
  101. package/examples/javascript/xy-draggable-range/package.json +1 -1
  102. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  103. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  104. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  105. package/examples/javascript/xy-line/package.json +1 -1
  106. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  107. package/examples/javascript/xy-live-data/package.json +1 -1
  108. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  109. package/examples/javascript/xy-ohlc/package.json +1 -1
  110. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  111. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  112. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  113. package/examples/javascript/xy-stacked-column/package.json +1 -1
  114. package/examples/javascript/xy-stacked-step/package.json +1 -1
  115. package/examples/javascript/xy-stock/package.json +1 -1
  116. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  117. package/examples/typescript/flow-chord/package.json +1 -1
  118. package/examples/typescript/flow-chord-directed/package.json +1 -1
  119. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  120. package/examples/typescript/flow-sankey/package.json +1 -1
  121. package/examples/typescript/gauge/package.json +1 -1
  122. package/examples/typescript/gauge-bands/package.json +1 -1
  123. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  124. package/examples/typescript/hierarchy-pack/package.json +1 -1
  125. package/examples/typescript/hierarchy-partition/package.json +1 -1
  126. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  127. package/examples/typescript/hierarchy-tree/package.json +1 -1
  128. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  129. package/examples/typescript/json/README.md +6 -0
  130. package/examples/typescript/json/index.css +11 -0
  131. package/examples/typescript/json/index.html +12 -0
  132. package/examples/typescript/json/index.ts +94 -0
  133. package/examples/typescript/json/package.json +18 -0
  134. package/examples/typescript/json/tsconfig.json +12 -0
  135. package/examples/typescript/json/webpack.config.js +45 -0
  136. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  137. package/examples/typescript/map-day-and-night/package.json +1 -1
  138. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  139. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  140. package/examples/typescript/map-with-bubbles/package.json +1 -1
  141. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  142. package/examples/typescript/misc-40-charts/package.json +1 -1
  143. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  144. package/examples/typescript/pie-chart/package.json +1 -1
  145. package/examples/typescript/pie-donut-chart/package.json +1 -1
  146. package/examples/typescript/pie-variable-radius/package.json +1 -1
  147. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  148. package/examples/typescript/radar-heat-map/package.json +1 -1
  149. package/examples/typescript/radar-line/package.json +1 -1
  150. package/examples/typescript/radar-time-line/package.json +1 -1
  151. package/examples/typescript/sliced-funnel/package.json +1 -1
  152. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  153. package/examples/typescript/sliced-pyramid/package.json +1 -1
  154. package/examples/typescript/venn-diagram/package.json +1 -1
  155. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  156. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  157. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  158. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  159. package/examples/typescript/xy-bubble/package.json +1 -1
  160. package/examples/typescript/xy-candlestick/package.json +1 -1
  161. package/examples/typescript/xy-clustered-column/package.json +1 -1
  162. package/examples/typescript/xy-column/package.json +1 -1
  163. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  164. package/examples/typescript/xy-data-grouping/package.json +1 -1
  165. package/examples/typescript/xy-draggable-range/package.json +1 -1
  166. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  167. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  168. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  169. package/examples/typescript/xy-line/package.json +1 -1
  170. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  171. package/examples/typescript/xy-live-data/package.json +1 -1
  172. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  173. package/examples/typescript/xy-ohlc/package.json +1 -1
  174. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  175. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  176. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  177. package/examples/typescript/xy-stacked-column/package.json +1 -1
  178. package/examples/typescript/xy-stacked-step/package.json +1 -1
  179. package/examples/typescript/xy-stock/package.json +1 -1
  180. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  181. package/index.d.ts +4 -0
  182. package/index.d.ts.map +1 -1
  183. package/index.js +4 -0
  184. package/index.js.map +1 -1
  185. package/locales/lt_LT.js +25 -25
  186. package/locales/lt_LT.js.map +1 -1
  187. package/package.json +9 -9
  188. package/xy.d.ts +1 -0
  189. package/xy.d.ts.map +1 -1
  190. package/xy.js +1 -0
  191. package/xy.js.map +1 -1
@@ -58,6 +58,12 @@ var ValueAxis = /** @class */ (function (_super) {
58
58
  writable: true,
59
59
  value: void 0
60
60
  });
61
+ Object.defineProperty(_this, "_minLogAdjusted", {
62
+ enumerable: true,
63
+ configurable: true,
64
+ writable: true,
65
+ value: 1
66
+ });
61
67
  return _this;
62
68
  }
63
69
  /**
@@ -124,6 +130,7 @@ var ValueAxis = /** @class */ (function (_super) {
124
130
  //if (this._dirtyExtremes || this.isPrivateDirty("width") || this.isPrivateDirty("height") || this.isDirty("min") || this.isDirty("max") || this.isDirty("extraMin") || this.isDirty("extraMax") || this.isDirty("logarithmic") || this.isDirty("treatZeroAs") || this.isDirty("baseValue") || this.isDirty("strictMinMax") || this.isDirty("maxPrecision")) {
125
131
  if (this._sizeDirty || this._dirtyExtremes || this._valuesDirty || this.isPrivateDirty("width") || this.isPrivateDirty("height") || this.isDirty("min") || this.isDirty("max") || this.isDirty("extraMin") || this.isDirty("extraMax") || this.isDirty("logarithmic") || this.isDirty("treatZeroAs") || this.isDirty("baseValue") || this.isDirty("strictMinMax") || this.isDirty("maxPrecision") || this.isDirty("numberFormat")) {
126
132
  this._getMinMax();
133
+ this.ghostLabel.set("text", "");
127
134
  this._dirtyExtremes = false;
128
135
  }
129
136
  if (this._dirtySelectionExtremes && !this._isPanning) {
@@ -177,8 +184,26 @@ var ValueAxis = /** @class */ (function (_super) {
177
184
  var selectionMax = this.getPrivate("selectionMax") + step;
178
185
  var value = selectionMin - step;
179
186
  var i = 0;
187
+ var differencePower = 1;
188
+ var minLog = min;
180
189
  if (logarithmic) {
181
- value = selectionMin;
190
+ value = this._minLogAdjusted;
191
+ if (value < selectionMin) {
192
+ while (value < selectionMin) {
193
+ value += step;
194
+ }
195
+ }
196
+ minLog = value;
197
+ if (minLog <= 0) {
198
+ minLog = 1;
199
+ if (step < 1) {
200
+ minLog = step;
201
+ }
202
+ }
203
+ differencePower = Math.log(selectionMax - step) * Math.LOG10E - Math.log(minLog) * Math.LOG10E;
204
+ if (differencePower > 2) {
205
+ value = Math.pow(10, Math.log(minLog) * Math.LOG10E - 1);
206
+ }
182
207
  }
183
208
  while (value < selectionMax) {
184
209
  var dataItem = void 0;
@@ -204,9 +229,8 @@ var ValueAxis = /** @class */ (function (_super) {
204
229
  value += step;
205
230
  }
206
231
  else {
207
- var differencePower = Math.log(max) * Math.LOG10E - Math.log(min) * Math.LOG10E;
208
- if (differencePower > 1) {
209
- value = Math.pow(10, Math.log(min) * Math.LOG10E + i);
232
+ if (differencePower > 2) {
233
+ value = Math.pow(10, Math.log(minLog) * Math.LOG10E + i);
210
234
  }
211
235
  else {
212
236
  value += step;
@@ -626,6 +650,14 @@ var ValueAxis = /** @class */ (function (_super) {
626
650
  var maxDefined = this.get("max");
627
651
  var extraMin = this.get("extraMin", 0);
628
652
  var extraMax = this.get("extraMax", 0);
653
+ if (this.get("logarithmic")) {
654
+ if (this.get("extraMin") == null) {
655
+ extraMin = 0.1;
656
+ }
657
+ if (this.get("extraMax") == null) {
658
+ extraMax = 0.2;
659
+ }
660
+ }
629
661
  var gridCount = this.get("renderer").gridCount();
630
662
  var strictMinMax = this.get("strictMinMax", false);
631
663
  if ($type.isNumber(min) && $type.isNumber(max)) {
@@ -703,11 +735,11 @@ var ValueAxis = /** @class */ (function (_super) {
703
735
  selectionMin_1 = minMaxStep2.min;
704
736
  selectionMax_1 = minMaxStep2.max;
705
737
  }
738
+ selectionMin_1 -= (selectionMax_1 - selectionMin_1) * extraMin;
739
+ selectionMax_1 += (selectionMax_1 - selectionMin_1) * extraMax;
706
740
  var minMaxStep = this._adjustMinMax(selectionMin_1, selectionMax_1, gridCount);
707
741
  selectionMin_1 = minMaxStep.min;
708
742
  selectionMax_1 = minMaxStep.max;
709
- selectionMin_1 -= (selectionMax_1 - selectionMin_1) * extraMin;
710
- selectionMax_1 += (selectionMax_1 - selectionMin_1) * extraMax;
711
743
  selectionMin_1 = $math.fitToRange(selectionMin_1, min, max);
712
744
  selectionMax_1 = $math.fitToRange(selectionMax_1, min, max);
713
745
  // do it for the second time !important
@@ -730,6 +762,14 @@ var ValueAxis = /** @class */ (function (_super) {
730
762
  selectionMax_1 = Math.min(selectionMax_1, maxDefined);
731
763
  }
732
764
  }
765
+ if (this.get("logarithmic")) {
766
+ if (selectionMin_1 < min) {
767
+ selectionMin_1 = min;
768
+ }
769
+ if (selectionMax_1 > max) {
770
+ selectionMax_1 = max;
771
+ }
772
+ }
733
773
  var start = this.valueToFinalPosition(selectionMin_1);
734
774
  var end = this.valueToFinalPosition(selectionMax_1);
735
775
  this.setPrivateRaw("selectionMinFinal", selectionMin_1);
@@ -751,6 +791,14 @@ var ValueAxis = /** @class */ (function (_super) {
751
791
  var max = -Infinity;
752
792
  var extraMin = this.get("extraMin", 0);
753
793
  var extraMax = this.get("extraMax", 0);
794
+ if (this.get("logarithmic")) {
795
+ if (this.get("extraMin") == null) {
796
+ extraMin = 0.1;
797
+ }
798
+ if (this.get("extraMax") == null) {
799
+ extraMax = 0.2;
800
+ }
801
+ }
754
802
  var minDiff = Infinity;
755
803
  $array.each(this.series, function (series) {
756
804
  if (!series.get("ignoreMinMax")) {
@@ -816,6 +864,8 @@ var ValueAxis = /** @class */ (function (_super) {
816
864
  if (min === Infinity || max === -Infinity) {
817
865
  return;
818
866
  }
867
+ var initialMin = min;
868
+ var initialMax = max;
819
869
  // adapter
820
870
  var minAdapted = this.adapters.fold("min", min);
821
871
  var maxAdapted = this.adapters.fold("max", max);
@@ -848,6 +898,16 @@ var ValueAxis = /** @class */ (function (_super) {
848
898
  // add extras
849
899
  min -= (max - min) * extraMin;
850
900
  max += (max - min) * extraMax;
901
+ if (this.get("logarithmic")) {
902
+ // don't let min go below 0 if real min is >= 0
903
+ if (min < 0 && initialMin >= 0) {
904
+ min = 0;
905
+ }
906
+ // don't let max go above 0 if real max is <= 0
907
+ if (max > 0 && initialMax <= 0) {
908
+ max = 0;
909
+ }
910
+ }
851
911
  this._minReal = min;
852
912
  this._maxReal = max;
853
913
  var strict = this.get("strictMinMax");
@@ -901,6 +961,14 @@ var ValueAxis = /** @class */ (function (_super) {
901
961
  max = minMaxStep.max;
902
962
  }
903
963
  this.setPrivateRaw("maxZoomFactor", (max - min) / minDiff * this.get("maxZoomFactor", 100));
964
+ if (this.get("logarithmic")) {
965
+ this._minLogAdjusted = min;
966
+ min = this._minReal;
967
+ max = this._maxReal;
968
+ if (min <= 0) {
969
+ min = initialMin;
970
+ }
971
+ }
904
972
  if ($type.isNumber(min) && $type.isNumber(max)) {
905
973
  if (this.getPrivate("minFinal") !== min || this.getPrivate("maxFinal") !== max) {
906
974
  this.setPrivate("minFinal", min);
@@ -918,7 +986,6 @@ var ValueAxis = /** @class */ (function (_super) {
918
986
  configurable: true,
919
987
  writable: true,
920
988
  value: function (min, max, gridCount, strictMode) {
921
- var logarithmic = this.get("logarithmic");
922
989
  // will fail if 0
923
990
  if (gridCount <= 1) {
924
991
  gridCount = 1;
@@ -941,51 +1008,24 @@ var ValueAxis = /** @class */ (function (_super) {
941
1008
  if (strictMode) {
942
1009
  extra = 0;
943
1010
  }
944
- if (!logarithmic) {
945
- // round down min
946
- if (strictMode) {
947
- min = Math.floor(min / power) * power;
948
- // round up max
949
- max = Math.ceil(max / power) * power;
950
- }
951
- else {
952
- min = Math.ceil(min / power) * power - extra;
953
- // round up max
954
- max = Math.floor(max / power) * power + extra;
955
- }
956
- // don't let min go below 0 if real min is >= 0
957
- if (min < 0 && initialMin >= 0) {
958
- min = 0;
959
- }
960
- // don't let max go above 0 if real max is <= 0
961
- if (max > 0 && initialMax <= 0) {
962
- max = 0;
963
- }
1011
+ // round down min
1012
+ if (strictMode) {
1013
+ min = Math.floor(min / power) * power;
1014
+ // round up max
1015
+ max = Math.ceil(max / power) * power;
964
1016
  }
965
- // logarithmic
966
1017
  else {
967
- if (min <= 0) {
968
- //throw Error("Logarithmic value axis can not have values <= 0.");
969
- min = this.get("baseValue", 0);
970
- }
971
- if (min === Infinity) {
972
- min = 1;
973
- }
974
- if (max === -Infinity) {
975
- max = 10;
976
- }
977
- min = Math.pow(10, Math.floor(Math.log(Math.abs(min)) * Math.LOG10E));
978
- max = Math.pow(10, Math.ceil(Math.log(Math.abs(max)) * Math.LOG10E));
979
- if (this.get("strictMinMax")) {
980
- var minDefined = this.get("min");
981
- var maxDefined = this.get("max");
982
- if ($type.isNumber(minDefined) && minDefined > 0) {
983
- min = minDefined;
984
- }
985
- if ($type.isNumber(maxDefined) && maxDefined > 0) {
986
- max = maxDefined;
987
- }
988
- }
1018
+ min = Math.ceil(min / power) * power - extra;
1019
+ // round up max
1020
+ max = Math.floor(max / power) * power + extra;
1021
+ }
1022
+ // don't let min go below 0 if real min is >= 0
1023
+ if (min < 0 && initialMin >= 0) {
1024
+ min = 0;
1025
+ }
1026
+ // don't let max go above 0 if real max is <= 0
1027
+ if (max > 0 && initialMax <= 0) {
1028
+ max = 0;
989
1029
  }
990
1030
  exponent = Math.log(Math.abs(difference)) * Math.LOG10E;
991
1031
  power = Math.pow(10, Math.floor(exponent));
@@ -1018,27 +1058,25 @@ var ValueAxis = /** @class */ (function (_super) {
1018
1058
  // round step
1019
1059
  step = $math.round(step, decCount);
1020
1060
  }
1021
- if (!logarithmic) {
1022
- // final min and max
1023
- var minCount = Math.floor(min / step);
1024
- min = $math.round(step * minCount, decCount);
1025
- var maxCount = void 0;
1026
- if (!strictMode) {
1027
- maxCount = Math.ceil(max / step);
1028
- }
1029
- else {
1030
- maxCount = Math.floor(max / step);
1031
- }
1032
- if (maxCount === minCount) {
1033
- maxCount++;
1034
- }
1035
- max = $math.round(step * maxCount, decCount);
1036
- if (max < initialMax) {
1037
- max = max + step;
1038
- }
1039
- if (min > initialMin) {
1040
- min = min - step;
1041
- }
1061
+ // final min and max
1062
+ var minCount = Math.floor(min / step);
1063
+ min = $math.round(step * minCount, decCount);
1064
+ var maxCount;
1065
+ if (!strictMode) {
1066
+ maxCount = Math.ceil(max / step);
1067
+ }
1068
+ else {
1069
+ maxCount = Math.floor(max / step);
1070
+ }
1071
+ if (maxCount === minCount) {
1072
+ maxCount++;
1073
+ }
1074
+ max = $math.round(step * maxCount, decCount);
1075
+ if (max < initialMax) {
1076
+ max = max + step;
1077
+ }
1078
+ if (min > initialMin) {
1079
+ min = min - step;
1042
1080
  }
1043
1081
  step = this.fixSmallStep(step);
1044
1082
  return { min: min, max: max, step: step };