@amcharts/amcharts5 5.1.9 → 5.1.12

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 (288) hide show
  1. package/.internal/charts/hierarchy/ForceDirected.d.ts +1 -0
  2. package/.internal/charts/hierarchy/ForceDirected.d.ts.map +1 -1
  3. package/.internal/charts/hierarchy/ForceDirected.js +9 -0
  4. package/.internal/charts/hierarchy/ForceDirected.js.map +1 -1
  5. package/.internal/charts/hierarchy/LinkedHierarchy.d.ts +1 -0
  6. package/.internal/charts/hierarchy/LinkedHierarchy.d.ts.map +1 -1
  7. package/.internal/charts/hierarchy/LinkedHierarchy.js +12 -3
  8. package/.internal/charts/hierarchy/LinkedHierarchy.js.map +1 -1
  9. package/.internal/charts/radar/RadarChart.d.ts.map +1 -1
  10. package/.internal/charts/radar/RadarChart.js +0 -2
  11. package/.internal/charts/radar/RadarChart.js.map +1 -1
  12. package/.internal/charts/xy/XYChart.d.ts +8 -1
  13. package/.internal/charts/xy/XYChart.d.ts.map +1 -1
  14. package/.internal/charts/xy/XYChart.js +22 -3
  15. package/.internal/charts/xy/XYChart.js.map +1 -1
  16. package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
  17. package/.internal/charts/xy/XYChartDefaultTheme.js +0 -2
  18. package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
  19. package/.internal/charts/xy/axes/Axis.d.ts.map +1 -1
  20. package/.internal/charts/xy/axes/Axis.js +1 -0
  21. package/.internal/charts/xy/axes/Axis.js.map +1 -1
  22. package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
  23. package/.internal/charts/xy/axes/AxisRendererX.js +1 -0
  24. package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
  25. package/.internal/charts/xy/axes/DateAxis.d.ts.map +1 -1
  26. package/.internal/charts/xy/axes/DateAxis.js +46 -4
  27. package/.internal/charts/xy/axes/DateAxis.js.map +1 -1
  28. package/.internal/charts/xy/axes/ValueAxis.d.ts +13 -0
  29. package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
  30. package/.internal/charts/xy/axes/ValueAxis.js +125 -75
  31. package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
  32. package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
  33. package/.internal/charts/xy/series/BaseColumnSeries.js +9 -0
  34. package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
  35. package/.internal/charts/xy/series/XYSeries.d.ts +11 -0
  36. package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
  37. package/.internal/charts/xy/series/XYSeries.js +44 -11
  38. package/.internal/charts/xy/series/XYSeries.js.map +1 -1
  39. package/.internal/core/Root.d.ts +1 -0
  40. package/.internal/core/Root.d.ts.map +1 -1
  41. package/.internal/core/Root.js +11 -2
  42. package/.internal/core/Root.js.map +1 -1
  43. package/.internal/core/render/GridLayout.d.ts.map +1 -1
  44. package/.internal/core/render/GridLayout.js +11 -9
  45. package/.internal/core/render/GridLayout.js.map +1 -1
  46. package/.internal/core/render/HorizontalLayout.d.ts.map +1 -1
  47. package/.internal/core/render/HorizontalLayout.js +40 -34
  48. package/.internal/core/render/HorizontalLayout.js.map +1 -1
  49. package/.internal/core/render/Legend.d.ts.map +1 -1
  50. package/.internal/core/render/Legend.js +7 -0
  51. package/.internal/core/render/Legend.js.map +1 -1
  52. package/.internal/core/render/Scrollbar.d.ts.map +1 -1
  53. package/.internal/core/render/Scrollbar.js +3 -0
  54. package/.internal/core/render/Scrollbar.js.map +1 -1
  55. package/.internal/core/render/Series.d.ts +5 -0
  56. package/.internal/core/render/Series.d.ts.map +1 -1
  57. package/.internal/core/render/Series.js +40 -10
  58. package/.internal/core/render/Series.js.map +1 -1
  59. package/.internal/core/render/Sprite.d.ts +4 -0
  60. package/.internal/core/render/Sprite.d.ts.map +1 -1
  61. package/.internal/core/render/Sprite.js +14 -0
  62. package/.internal/core/render/Sprite.js.map +1 -1
  63. package/.internal/core/render/VerticalLayout.d.ts.map +1 -1
  64. package/.internal/core/render/VerticalLayout.js +40 -34
  65. package/.internal/core/render/VerticalLayout.js.map +1 -1
  66. package/.internal/core/render/backend/CanvasRenderer.d.ts +1 -0
  67. package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
  68. package/.internal/core/render/backend/CanvasRenderer.js +17 -1
  69. package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
  70. package/.internal/core/render/backend/Renderer.d.ts +1 -0
  71. package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
  72. package/.internal/core/render/backend/Renderer.js.map +1 -1
  73. package/.internal/core/util/PopulateString.js +12 -2
  74. package/.internal/core/util/PopulateString.js.map +1 -1
  75. package/.internal/core/util/Time.d.ts.map +1 -1
  76. package/.internal/core/util/Time.js +4 -0
  77. package/.internal/core/util/Time.js.map +1 -1
  78. package/.internal/plugins/exporting/ExportingMenu.d.ts.map +1 -1
  79. package/.internal/plugins/exporting/ExportingMenu.js +3 -2
  80. package/.internal/plugins/exporting/ExportingMenu.js.map +1 -1
  81. package/.internal/plugins/json/Classes-script.d.ts +271 -0
  82. package/.internal/plugins/json/Classes-script.d.ts.map +1 -0
  83. package/.internal/plugins/json/Classes-script.js +139 -0
  84. package/.internal/plugins/json/Classes-script.js.map +1 -0
  85. package/.internal/plugins/json/Classes.d.ts +262 -262
  86. package/.internal/plugins/json/Classes.d.ts.map +1 -1
  87. package/.internal/plugins/json/Classes.js +131 -262
  88. package/.internal/plugins/json/Classes.js.map +1 -1
  89. package/.internal/plugins/json/Json.d.ts +3 -3
  90. package/.internal/plugins/json/Json.d.ts.map +1 -1
  91. package/.internal/plugins/json/Json.js +301 -34
  92. package/.internal/plugins/json/Json.js.map +1 -1
  93. package/CHANGELOG.md +45 -0
  94. package/examples/javascript/flow-chord/package.json +1 -1
  95. package/examples/javascript/flow-chord-directed/package.json +1 -1
  96. package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
  97. package/examples/javascript/flow-sankey/package.json +1 -1
  98. package/examples/javascript/gauge/package.json +1 -1
  99. package/examples/javascript/gauge-bands/package.json +1 -1
  100. package/examples/javascript/hierarchy-force-directed/package.json +1 -1
  101. package/examples/javascript/hierarchy-pack/package.json +1 -1
  102. package/examples/javascript/hierarchy-partition/package.json +1 -1
  103. package/examples/javascript/hierarchy-sunburst/package.json +1 -1
  104. package/examples/javascript/hierarchy-tree/package.json +1 -1
  105. package/examples/javascript/hierarchy-treemap/package.json +1 -1
  106. package/examples/javascript/json/README.md +6 -0
  107. package/examples/javascript/json/index.css +11 -0
  108. package/examples/javascript/json/index.html +12 -0
  109. package/examples/javascript/json/index.js +206 -0
  110. package/examples/javascript/json/package.json +16 -0
  111. package/examples/javascript/json/webpack.config.js +38 -0
  112. package/examples/javascript/map-animating-along-lines/package.json +1 -1
  113. package/examples/javascript/map-day-and-night/package.json +1 -1
  114. package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
  115. package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
  116. package/examples/javascript/map-with-bubbles/package.json +1 -1
  117. package/examples/javascript/map-zoom-to-country/package.json +1 -1
  118. package/examples/javascript/misc-40-charts/package.json +1 -1
  119. package/examples/javascript/misc-microchart-grid/package.json +1 -1
  120. package/examples/javascript/pie-chart/package.json +1 -1
  121. package/examples/javascript/pie-donut-chart/package.json +1 -1
  122. package/examples/javascript/pie-variable-radius/package.json +1 -1
  123. package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
  124. package/examples/javascript/radar-heat-map/package.json +1 -1
  125. package/examples/javascript/radar-line/package.json +1 -1
  126. package/examples/javascript/radar-time-line/package.json +1 -1
  127. package/examples/javascript/sliced-funnel/package.json +1 -1
  128. package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
  129. package/examples/javascript/sliced-pyramid/package.json +1 -1
  130. package/examples/javascript/venn-diagram/package.json +1 -1
  131. package/examples/javascript/wordcloud-with-data/package.json +1 -1
  132. package/examples/javascript/wordcloud-with-text/package.json +1 -1
  133. package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
  134. package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  135. package/examples/javascript/xy-bubble/package.json +1 -1
  136. package/examples/javascript/xy-candlestick/package.json +1 -1
  137. package/examples/javascript/xy-clustered-column/package.json +1 -1
  138. package/examples/javascript/xy-column/package.json +1 -1
  139. package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
  140. package/examples/javascript/xy-data-grouping/package.json +1 -1
  141. package/examples/javascript/xy-draggable-range/package.json +1 -1
  142. package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  143. package/examples/javascript/xy-dumbbell plot/package.json +1 -1
  144. package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
  145. package/examples/javascript/xy-line/package.json +1 -1
  146. package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
  147. package/examples/javascript/xy-live-data/package.json +1 -1
  148. package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
  149. package/examples/javascript/xy-ohlc/package.json +1 -1
  150. package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
  151. package/examples/javascript/xy-smoothed-line/package.json +1 -1
  152. package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
  153. package/examples/javascript/xy-stacked-column/package.json +1 -1
  154. package/examples/javascript/xy-stacked-step/package.json +1 -1
  155. package/examples/javascript/xy-stock/package.json +1 -1
  156. package/examples/javascript/xy-stock-comparing/package.json +1 -1
  157. package/examples/typescript/flow-chord/package.json +1 -1
  158. package/examples/typescript/flow-chord/webpack.config.js +1 -1
  159. package/examples/typescript/flow-chord-directed/package.json +1 -1
  160. package/examples/typescript/flow-chord-directed/webpack.config.js +1 -1
  161. package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
  162. package/examples/typescript/flow-chord-non-ribbon/webpack.config.js +1 -1
  163. package/examples/typescript/flow-sankey/package.json +1 -1
  164. package/examples/typescript/flow-sankey/webpack.config.js +1 -1
  165. package/examples/typescript/gauge/package.json +1 -1
  166. package/examples/typescript/gauge/webpack.config.js +1 -1
  167. package/examples/typescript/gauge-bands/package.json +1 -1
  168. package/examples/typescript/gauge-bands/webpack.config.js +1 -1
  169. package/examples/typescript/hierarchy-force-directed/package.json +1 -1
  170. package/examples/typescript/hierarchy-force-directed/webpack.config.js +1 -1
  171. package/examples/typescript/hierarchy-pack/package.json +1 -1
  172. package/examples/typescript/hierarchy-pack/webpack.config.js +1 -1
  173. package/examples/typescript/hierarchy-partition/package.json +1 -1
  174. package/examples/typescript/hierarchy-partition/webpack.config.js +1 -1
  175. package/examples/typescript/hierarchy-sunburst/package.json +1 -1
  176. package/examples/typescript/hierarchy-sunburst/webpack.config.js +1 -1
  177. package/examples/typescript/hierarchy-tree/package.json +1 -1
  178. package/examples/typescript/hierarchy-tree/webpack.config.js +1 -1
  179. package/examples/typescript/hierarchy-treemap/package.json +1 -1
  180. package/examples/typescript/hierarchy-treemap/webpack.config.js +1 -1
  181. package/examples/typescript/json/README.md +6 -0
  182. package/examples/typescript/json/index.css +11 -0
  183. package/examples/typescript/json/index.html +12 -0
  184. package/examples/typescript/json/index.ts +206 -0
  185. package/examples/typescript/json/package.json +18 -0
  186. package/examples/typescript/json/tsconfig.json +12 -0
  187. package/examples/typescript/json/webpack.config.js +45 -0
  188. package/examples/typescript/map-animating-along-lines/package.json +1 -1
  189. package/examples/typescript/map-animating-along-lines/webpack.config.js +1 -1
  190. package/examples/typescript/map-day-and-night/package.json +1 -1
  191. package/examples/typescript/map-day-and-night/webpack.config.js +1 -1
  192. package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
  193. package/examples/typescript/map-globe-rotate-to-country/webpack.config.js +1 -1
  194. package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
  195. package/examples/typescript/map-globe-with-projected-circles/webpack.config.js +1 -1
  196. package/examples/typescript/map-with-bubbles/package.json +1 -1
  197. package/examples/typescript/map-with-bubbles/webpack.config.js +1 -1
  198. package/examples/typescript/map-zoom-to-country/package.json +1 -1
  199. package/examples/typescript/map-zoom-to-country/webpack.config.js +1 -1
  200. package/examples/typescript/misc-40-charts/package.json +1 -1
  201. package/examples/typescript/misc-40-charts/webpack.config.js +1 -1
  202. package/examples/typescript/misc-microchart-grid/package.json +1 -1
  203. package/examples/typescript/misc-microchart-grid/webpack.config.js +1 -1
  204. package/examples/typescript/pie-chart/package.json +1 -1
  205. package/examples/typescript/pie-chart/webpack.config.js +1 -1
  206. package/examples/typescript/pie-donut-chart/package.json +1 -1
  207. package/examples/typescript/pie-donut-chart/webpack.config.js +1 -1
  208. package/examples/typescript/pie-variable-radius/package.json +1 -1
  209. package/examples/typescript/pie-variable-radius/webpack.config.js +1 -1
  210. package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
  211. package/examples/typescript/radar-column-iwatch-style/webpack.config.js +1 -1
  212. package/examples/typescript/radar-heat-map/package.json +1 -1
  213. package/examples/typescript/radar-heat-map/webpack.config.js +1 -1
  214. package/examples/typescript/radar-line/package.json +1 -1
  215. package/examples/typescript/radar-line/webpack.config.js +1 -1
  216. package/examples/typescript/radar-time-line/package.json +1 -1
  217. package/examples/typescript/radar-time-line/webpack.config.js +1 -1
  218. package/examples/typescript/sliced-funnel/package.json +1 -1
  219. package/examples/typescript/sliced-funnel/webpack.config.js +1 -1
  220. package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
  221. package/examples/typescript/sliced-pictorial-stacked/webpack.config.js +1 -1
  222. package/examples/typescript/sliced-pyramid/package.json +1 -1
  223. package/examples/typescript/sliced-pyramid/webpack.config.js +1 -1
  224. package/examples/typescript/venn-diagram/package.json +1 -1
  225. package/examples/typescript/venn-diagram/webpack.config.js +1 -1
  226. package/examples/typescript/wordcloud-with-data/package.json +1 -1
  227. package/examples/typescript/wordcloud-with-data/webpack.config.js +1 -1
  228. package/examples/typescript/wordcloud-with-text/package.json +1 -1
  229. package/examples/typescript/wordcloud-with-text/webpack.config.js +1 -1
  230. package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
  231. package/examples/typescript/xy-100-percent-stacked-column/webpack.config.js +1 -1
  232. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
  233. package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/webpack.config.js +1 -1
  234. package/examples/typescript/xy-bubble/package.json +1 -1
  235. package/examples/typescript/xy-bubble/webpack.config.js +1 -1
  236. package/examples/typescript/xy-candlestick/package.json +1 -1
  237. package/examples/typescript/xy-candlestick/webpack.config.js +1 -1
  238. package/examples/typescript/xy-clustered-column/package.json +1 -1
  239. package/examples/typescript/xy-clustered-column/webpack.config.js +1 -1
  240. package/examples/typescript/xy-column/package.json +1 -1
  241. package/examples/typescript/xy-column/webpack.config.js +1 -1
  242. package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
  243. package/examples/typescript/xy-comparing-series-google-analytics-style/webpack.config.js +1 -1
  244. package/examples/typescript/xy-data-grouping/package.json +1 -1
  245. package/examples/typescript/xy-data-grouping/webpack.config.js +1 -1
  246. package/examples/typescript/xy-draggable-range/package.json +1 -1
  247. package/examples/typescript/xy-draggable-range/webpack.config.js +1 -1
  248. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
  249. package/examples/typescript/xy-drawing-series-with-mouse-or-touch/webpack.config.js +1 -1
  250. package/examples/typescript/xy-dumbbell plot/package.json +1 -1
  251. package/examples/typescript/xy-dumbbell plot/webpack.config.js +1 -1
  252. package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
  253. package/examples/typescript/xy-evenly-spaced-date-axis/webpack.config.js +1 -1
  254. package/examples/typescript/xy-line/package.json +1 -1
  255. package/examples/typescript/xy-line/webpack.config.js +1 -1
  256. package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
  257. package/examples/typescript/xy-line-highlight-on-legend-hover/webpack.config.js +1 -1
  258. package/examples/typescript/xy-live-data/package.json +1 -1
  259. package/examples/typescript/xy-live-data/webpack.config.js +1 -1
  260. package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
  261. package/examples/typescript/xy-multiple-synced-value-axes/webpack.config.js +1 -1
  262. package/examples/typescript/xy-ohlc/package.json +1 -1
  263. package/examples/typescript/xy-ohlc/webpack.config.js +1 -1
  264. package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
  265. package/examples/typescript/xy-real-time-data-sorting/webpack.config.js +1 -1
  266. package/examples/typescript/xy-smoothed-line/package.json +1 -1
  267. package/examples/typescript/xy-smoothed-line/webpack.config.js +1 -1
  268. package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
  269. package/examples/typescript/xy-stacked-and-clustered-column/webpack.config.js +1 -1
  270. package/examples/typescript/xy-stacked-column/package.json +1 -1
  271. package/examples/typescript/xy-stacked-column/webpack.config.js +1 -1
  272. package/examples/typescript/xy-stacked-step/package.json +1 -1
  273. package/examples/typescript/xy-stacked-step/webpack.config.js +1 -1
  274. package/examples/typescript/xy-stock/package.json +1 -1
  275. package/examples/typescript/xy-stock/webpack.config.js +1 -1
  276. package/examples/typescript/xy-stock-comparing/package.json +1 -1
  277. package/examples/typescript/xy-stock-comparing/webpack.config.js +1 -1
  278. package/index.d.ts +4 -0
  279. package/index.d.ts.map +1 -1
  280. package/index.js +4 -0
  281. package/index.js.map +1 -1
  282. package/locales/lt_LT.js +25 -25
  283. package/locales/lt_LT.js.map +1 -1
  284. package/package.json +9 -9
  285. package/xy.d.ts +1 -0
  286. package/xy.d.ts.map +1 -1
  287. package/xy.js +1 -0
  288. 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
  /**
@@ -122,8 +128,9 @@ var ValueAxis = /** @class */ (function (_super) {
122
128
  }
123
129
  }
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
- 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")) {
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("strictMinMaxSelection") || 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,8 +650,17 @@ 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
- var strictMinMax = this.get("strictMinMax", false);
662
+ var selectionStrictMinMax = this.get("strictMinMaxSelection");
663
+ var strictMinMax = this.get("strictMinMax");
631
664
  if ($type.isNumber(min) && $type.isNumber(max)) {
632
665
  var selectionMin_1 = max;
633
666
  var selectionMax_1 = min;
@@ -703,11 +736,13 @@ var ValueAxis = /** @class */ (function (_super) {
703
736
  selectionMin_1 = minMaxStep2.min;
704
737
  selectionMax_1 = minMaxStep2.max;
705
738
  }
739
+ var selectionMinReal = selectionMin_1;
740
+ var selectionMaxReal = selectionMax_1;
741
+ selectionMin_1 -= (selectionMax_1 - selectionMin_1) * extraMin;
742
+ selectionMax_1 += (selectionMax_1 - selectionMin_1) * extraMax;
706
743
  var minMaxStep = this._adjustMinMax(selectionMin_1, selectionMax_1, gridCount);
707
744
  selectionMin_1 = minMaxStep.min;
708
745
  selectionMax_1 = minMaxStep.max;
709
- selectionMin_1 -= (selectionMax_1 - selectionMin_1) * extraMin;
710
- selectionMax_1 += (selectionMax_1 - selectionMin_1) * extraMax;
711
746
  selectionMin_1 = $math.fitToRange(selectionMin_1, min, max);
712
747
  selectionMax_1 = $math.fitToRange(selectionMax_1, min, max);
713
748
  // do it for the second time !important
@@ -730,6 +765,18 @@ var ValueAxis = /** @class */ (function (_super) {
730
765
  selectionMax_1 = Math.min(selectionMax_1, maxDefined);
731
766
  }
732
767
  }
768
+ if (selectionStrictMinMax) {
769
+ selectionMin_1 = selectionMinReal - (selectionMax_1 - selectionMin_1) * extraMin;
770
+ selectionMax_1 = selectionMaxReal + (selectionMax_1 - selectionMin_1) * extraMax;
771
+ }
772
+ if (this.get("logarithmic")) {
773
+ if (selectionMin_1 < min) {
774
+ selectionMin_1 = min;
775
+ }
776
+ if (selectionMax_1 > max) {
777
+ selectionMax_1 = max;
778
+ }
779
+ }
733
780
  var start = this.valueToFinalPosition(selectionMin_1);
734
781
  var end = this.valueToFinalPosition(selectionMax_1);
735
782
  this.setPrivateRaw("selectionMinFinal", selectionMin_1);
@@ -751,6 +798,14 @@ var ValueAxis = /** @class */ (function (_super) {
751
798
  var max = -Infinity;
752
799
  var extraMin = this.get("extraMin", 0);
753
800
  var extraMax = this.get("extraMax", 0);
801
+ if (this.get("logarithmic")) {
802
+ if (this.get("extraMin") == null) {
803
+ extraMin = 0.1;
804
+ }
805
+ if (this.get("extraMax") == null) {
806
+ extraMax = 0.2;
807
+ }
808
+ }
754
809
  var minDiff = Infinity;
755
810
  $array.each(this.series, function (series) {
756
811
  if (!series.get("ignoreMinMax")) {
@@ -816,6 +871,8 @@ var ValueAxis = /** @class */ (function (_super) {
816
871
  if (min === Infinity || max === -Infinity) {
817
872
  return;
818
873
  }
874
+ var initialMin = min;
875
+ var initialMax = max;
819
876
  // adapter
820
877
  var minAdapted = this.adapters.fold("min", min);
821
878
  var maxAdapted = this.adapters.fold("max", max);
@@ -848,9 +905,24 @@ var ValueAxis = /** @class */ (function (_super) {
848
905
  // add extras
849
906
  min -= (max - min) * extraMin;
850
907
  max += (max - min) * extraMax;
908
+ if (this.get("logarithmic")) {
909
+ // don't let min go below 0 if real min is >= 0
910
+ if (min < 0 && initialMin >= 0) {
911
+ min = 0;
912
+ }
913
+ // don't let max go above 0 if real max is <= 0
914
+ if (max > 0 && initialMax <= 0) {
915
+ max = 0;
916
+ }
917
+ }
851
918
  this._minReal = min;
852
919
  this._maxReal = max;
853
- var strict = this.get("strictMinMax");
920
+ var strictMinMax = this.get("strictMinMax");
921
+ var strictMinMaxSelection = this.get("strictMinMaxSelection", false);
922
+ if (strictMinMaxSelection) {
923
+ strictMinMax = strictMinMaxSelection;
924
+ }
925
+ var strict = strictMinMax;
854
926
  if ($type.isNumber(maxDefined)) {
855
927
  strict = true;
856
928
  }
@@ -863,7 +935,7 @@ var ValueAxis = /** @class */ (function (_super) {
863
935
  min = minMaxStep.min;
864
936
  max = minMaxStep.max;
865
937
  // return min max if strict
866
- if (this.get("strictMinMax")) {
938
+ if (strictMinMax) {
867
939
  if ($type.isNumber(minDefined)) {
868
940
  min = minDefined;
869
941
  }
@@ -901,6 +973,14 @@ var ValueAxis = /** @class */ (function (_super) {
901
973
  max = minMaxStep.max;
902
974
  }
903
975
  this.setPrivateRaw("maxZoomFactor", (max - min) / minDiff * this.get("maxZoomFactor", 100));
976
+ if (this.get("logarithmic")) {
977
+ this._minLogAdjusted = min;
978
+ min = this._minReal;
979
+ max = this._maxReal;
980
+ if (min <= 0) {
981
+ min = initialMin;
982
+ }
983
+ }
904
984
  if ($type.isNumber(min) && $type.isNumber(max)) {
905
985
  if (this.getPrivate("minFinal") !== min || this.getPrivate("maxFinal") !== max) {
906
986
  this.setPrivate("minFinal", min);
@@ -918,7 +998,6 @@ var ValueAxis = /** @class */ (function (_super) {
918
998
  configurable: true,
919
999
  writable: true,
920
1000
  value: function (min, max, gridCount, strictMode) {
921
- var logarithmic = this.get("logarithmic");
922
1001
  // will fail if 0
923
1002
  if (gridCount <= 1) {
924
1003
  gridCount = 1;
@@ -941,51 +1020,24 @@ var ValueAxis = /** @class */ (function (_super) {
941
1020
  if (strictMode) {
942
1021
  extra = 0;
943
1022
  }
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
- }
1023
+ // round down min
1024
+ if (strictMode) {
1025
+ min = Math.floor(min / power) * power;
1026
+ // round up max
1027
+ max = Math.ceil(max / power) * power;
964
1028
  }
965
- // logarithmic
966
1029
  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
- }
1030
+ min = Math.ceil(min / power) * power - extra;
1031
+ // round up max
1032
+ max = Math.floor(max / power) * power + extra;
1033
+ }
1034
+ // don't let min go below 0 if real min is >= 0
1035
+ if (min < 0 && initialMin >= 0) {
1036
+ min = 0;
1037
+ }
1038
+ // don't let max go above 0 if real max is <= 0
1039
+ if (max > 0 && initialMax <= 0) {
1040
+ max = 0;
989
1041
  }
990
1042
  exponent = Math.log(Math.abs(difference)) * Math.LOG10E;
991
1043
  power = Math.pow(10, Math.floor(exponent));
@@ -1018,27 +1070,25 @@ var ValueAxis = /** @class */ (function (_super) {
1018
1070
  // round step
1019
1071
  step = $math.round(step, decCount);
1020
1072
  }
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
- }
1073
+ // final min and max
1074
+ var minCount = Math.floor(min / step);
1075
+ min = $math.round(step * minCount, decCount);
1076
+ var maxCount;
1077
+ if (!strictMode) {
1078
+ maxCount = Math.ceil(max / step);
1079
+ }
1080
+ else {
1081
+ maxCount = Math.floor(max / step);
1082
+ }
1083
+ if (maxCount === minCount) {
1084
+ maxCount++;
1085
+ }
1086
+ max = $math.round(step * maxCount, decCount);
1087
+ if (max < initialMax) {
1088
+ max = max + step;
1089
+ }
1090
+ if (min > initialMin) {
1091
+ min = min - step;
1042
1092
  }
1043
1093
  step = this.fixSmallStep(step);
1044
1094
  return { min: min, max: max, step: step };