@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.
- package/.internal/charts/radar/RadarChart.d.ts.map +1 -1
- package/.internal/charts/radar/RadarChart.js +0 -2
- package/.internal/charts/radar/RadarChart.js.map +1 -1
- package/.internal/charts/xy/XYChart.d.ts.map +1 -1
- package/.internal/charts/xy/XYChart.js +7 -0
- package/.internal/charts/xy/XYChart.js.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.d.ts.map +1 -1
- package/.internal/charts/xy/XYChartDefaultTheme.js +0 -2
- package/.internal/charts/xy/XYChartDefaultTheme.js.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.d.ts.map +1 -1
- package/.internal/charts/xy/axes/AxisRendererX.js +1 -0
- package/.internal/charts/xy/axes/AxisRendererX.js.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.d.ts +1 -0
- package/.internal/charts/xy/axes/ValueAxis.d.ts.map +1 -1
- package/.internal/charts/xy/axes/ValueAxis.js +109 -71
- package/.internal/charts/xy/axes/ValueAxis.js.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/BaseColumnSeries.js +9 -0
- package/.internal/charts/xy/series/BaseColumnSeries.js.map +1 -1
- package/.internal/charts/xy/series/XYSeries.d.ts.map +1 -1
- package/.internal/charts/xy/series/XYSeries.js +6 -0
- package/.internal/charts/xy/series/XYSeries.js.map +1 -1
- package/.internal/core/Root.d.ts.map +1 -1
- package/.internal/core/Root.js +1 -0
- package/.internal/core/Root.js.map +1 -1
- package/.internal/core/render/Legend.d.ts.map +1 -1
- package/.internal/core/render/Legend.js +7 -0
- package/.internal/core/render/Legend.js.map +1 -1
- package/.internal/core/render/Series.d.ts.map +1 -1
- package/.internal/core/render/Series.js +11 -7
- package/.internal/core/render/Series.js.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.d.ts +1 -0
- package/.internal/core/render/backend/CanvasRenderer.d.ts.map +1 -1
- package/.internal/core/render/backend/CanvasRenderer.js +17 -1
- package/.internal/core/render/backend/CanvasRenderer.js.map +1 -1
- package/.internal/core/render/backend/Renderer.d.ts +1 -0
- package/.internal/core/render/backend/Renderer.d.ts.map +1 -1
- package/.internal/core/render/backend/Renderer.js.map +1 -1
- package/.internal/core/util/PopulateString.js +12 -2
- package/.internal/core/util/PopulateString.js.map +1 -1
- package/.internal/plugins/json/Classes-script.d.ts +271 -0
- package/.internal/plugins/json/Classes-script.d.ts.map +1 -0
- package/.internal/plugins/json/Classes-script.js +139 -0
- package/.internal/plugins/json/Classes-script.js.map +1 -0
- package/.internal/plugins/json/Classes.d.ts +262 -262
- package/.internal/plugins/json/Classes.d.ts.map +1 -1
- package/.internal/plugins/json/Classes.js +131 -262
- package/.internal/plugins/json/Classes.js.map +1 -1
- package/.internal/plugins/json/Json.d.ts +3 -3
- package/.internal/plugins/json/Json.d.ts.map +1 -1
- package/.internal/plugins/json/Json.js +239 -34
- package/.internal/plugins/json/Json.js.map +1 -1
- package/CHANGELOG.md +19 -0
- package/examples/javascript/flow-chord/package.json +1 -1
- package/examples/javascript/flow-chord-directed/package.json +1 -1
- package/examples/javascript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/javascript/flow-sankey/package.json +1 -1
- package/examples/javascript/gauge/package.json +1 -1
- package/examples/javascript/gauge-bands/package.json +1 -1
- package/examples/javascript/hierarchy-force-directed/package.json +1 -1
- package/examples/javascript/hierarchy-pack/package.json +1 -1
- package/examples/javascript/hierarchy-partition/package.json +1 -1
- package/examples/javascript/hierarchy-sunburst/package.json +1 -1
- package/examples/javascript/hierarchy-tree/package.json +1 -1
- package/examples/javascript/hierarchy-treemap/package.json +1 -1
- package/examples/javascript/json/README.md +6 -0
- package/examples/javascript/json/index.css +11 -0
- package/examples/javascript/json/index.html +12 -0
- package/examples/javascript/json/index.js +94 -0
- package/examples/javascript/json/package.json +16 -0
- package/examples/javascript/json/webpack.config.js +38 -0
- package/examples/javascript/map-animating-along-lines/package.json +1 -1
- package/examples/javascript/map-day-and-night/package.json +1 -1
- package/examples/javascript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/javascript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/javascript/map-with-bubbles/package.json +1 -1
- package/examples/javascript/map-zoom-to-country/package.json +1 -1
- package/examples/javascript/misc-40-charts/package.json +1 -1
- package/examples/javascript/misc-microchart-grid/package.json +1 -1
- package/examples/javascript/pie-chart/package.json +1 -1
- package/examples/javascript/pie-donut-chart/package.json +1 -1
- package/examples/javascript/pie-variable-radius/package.json +1 -1
- package/examples/javascript/radar-column-iwatch-style/package.json +1 -1
- package/examples/javascript/radar-heat-map/package.json +1 -1
- package/examples/javascript/radar-line/package.json +1 -1
- package/examples/javascript/radar-time-line/package.json +1 -1
- package/examples/javascript/sliced-funnel/package.json +1 -1
- package/examples/javascript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/javascript/sliced-pyramid/package.json +1 -1
- package/examples/javascript/venn-diagram/package.json +1 -1
- package/examples/javascript/wordcloud-with-data/package.json +1 -1
- package/examples/javascript/wordcloud-with-text/package.json +1 -1
- package/examples/javascript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/javascript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/javascript/xy-bubble/package.json +1 -1
- package/examples/javascript/xy-candlestick/package.json +1 -1
- package/examples/javascript/xy-clustered-column/package.json +1 -1
- package/examples/javascript/xy-column/package.json +1 -1
- package/examples/javascript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/javascript/xy-data-grouping/package.json +1 -1
- package/examples/javascript/xy-draggable-range/package.json +1 -1
- package/examples/javascript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/javascript/xy-dumbbell plot/package.json +1 -1
- package/examples/javascript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/javascript/xy-line/package.json +1 -1
- package/examples/javascript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/javascript/xy-live-data/package.json +1 -1
- package/examples/javascript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/javascript/xy-ohlc/package.json +1 -1
- package/examples/javascript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/javascript/xy-smoothed-line/package.json +1 -1
- package/examples/javascript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/javascript/xy-stacked-column/package.json +1 -1
- package/examples/javascript/xy-stacked-step/package.json +1 -1
- package/examples/javascript/xy-stock/package.json +1 -1
- package/examples/javascript/xy-stock-comparing/package.json +1 -1
- package/examples/typescript/flow-chord/package.json +1 -1
- package/examples/typescript/flow-chord-directed/package.json +1 -1
- package/examples/typescript/flow-chord-non-ribbon/package.json +1 -1
- package/examples/typescript/flow-sankey/package.json +1 -1
- package/examples/typescript/gauge/package.json +1 -1
- package/examples/typescript/gauge-bands/package.json +1 -1
- package/examples/typescript/hierarchy-force-directed/package.json +1 -1
- package/examples/typescript/hierarchy-pack/package.json +1 -1
- package/examples/typescript/hierarchy-partition/package.json +1 -1
- package/examples/typescript/hierarchy-sunburst/package.json +1 -1
- package/examples/typescript/hierarchy-tree/package.json +1 -1
- package/examples/typescript/hierarchy-treemap/package.json +1 -1
- package/examples/typescript/json/README.md +6 -0
- package/examples/typescript/json/index.css +11 -0
- package/examples/typescript/json/index.html +12 -0
- package/examples/typescript/json/index.ts +94 -0
- package/examples/typescript/json/package.json +18 -0
- package/examples/typescript/json/tsconfig.json +12 -0
- package/examples/typescript/json/webpack.config.js +45 -0
- package/examples/typescript/map-animating-along-lines/package.json +1 -1
- package/examples/typescript/map-day-and-night/package.json +1 -1
- package/examples/typescript/map-globe-rotate-to-country/package.json +1 -1
- package/examples/typescript/map-globe-with-projected-circles/package.json +1 -1
- package/examples/typescript/map-with-bubbles/package.json +1 -1
- package/examples/typescript/map-zoom-to-country/package.json +1 -1
- package/examples/typescript/misc-40-charts/package.json +1 -1
- package/examples/typescript/misc-microchart-grid/package.json +1 -1
- package/examples/typescript/pie-chart/package.json +1 -1
- package/examples/typescript/pie-donut-chart/package.json +1 -1
- package/examples/typescript/pie-variable-radius/package.json +1 -1
- package/examples/typescript/radar-column-iwatch-style/package.json +1 -1
- package/examples/typescript/radar-heat-map/package.json +1 -1
- package/examples/typescript/radar-line/package.json +1 -1
- package/examples/typescript/radar-time-line/package.json +1 -1
- package/examples/typescript/sliced-funnel/package.json +1 -1
- package/examples/typescript/sliced-pictorial-stacked/package.json +1 -1
- package/examples/typescript/sliced-pyramid/package.json +1 -1
- package/examples/typescript/venn-diagram/package.json +1 -1
- package/examples/typescript/wordcloud-with-data/package.json +1 -1
- package/examples/typescript/wordcloud-with-text/package.json +1 -1
- package/examples/typescript/xy-100-percent-stacked-column/package.json +1 -1
- package/examples/typescript/xy-animated-bullet-at-the-end-of-the-series/package.json +1 -1
- package/examples/typescript/xy-bubble/package.json +1 -1
- package/examples/typescript/xy-candlestick/package.json +1 -1
- package/examples/typescript/xy-clustered-column/package.json +1 -1
- package/examples/typescript/xy-column/package.json +1 -1
- package/examples/typescript/xy-comparing-series-google-analytics-style/package.json +1 -1
- package/examples/typescript/xy-data-grouping/package.json +1 -1
- package/examples/typescript/xy-draggable-range/package.json +1 -1
- package/examples/typescript/xy-drawing-series-with-mouse-or-touch/package.json +1 -1
- package/examples/typescript/xy-dumbbell plot/package.json +1 -1
- package/examples/typescript/xy-evenly-spaced-date-axis/package.json +1 -1
- package/examples/typescript/xy-line/package.json +1 -1
- package/examples/typescript/xy-line-highlight-on-legend-hover/package.json +1 -1
- package/examples/typescript/xy-live-data/package.json +1 -1
- package/examples/typescript/xy-multiple-synced-value-axes/package.json +1 -1
- package/examples/typescript/xy-ohlc/package.json +1 -1
- package/examples/typescript/xy-real-time-data-sorting/package.json +1 -1
- package/examples/typescript/xy-smoothed-line/package.json +1 -1
- package/examples/typescript/xy-stacked-and-clustered-column/package.json +1 -1
- package/examples/typescript/xy-stacked-column/package.json +1 -1
- package/examples/typescript/xy-stacked-step/package.json +1 -1
- package/examples/typescript/xy-stock/package.json +1 -1
- package/examples/typescript/xy-stock-comparing/package.json +1 -1
- package/index.d.ts +4 -0
- package/index.d.ts.map +1 -1
- package/index.js +4 -0
- package/index.js.map +1 -1
- package/locales/lt_LT.js +25 -25
- package/locales/lt_LT.js.map +1 -1
- package/package.json +9 -9
- package/xy.d.ts +1 -0
- package/xy.d.ts.map +1 -1
- package/xy.js +1 -0
- 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 =
|
|
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
|
-
|
|
208
|
-
|
|
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
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
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
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
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
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
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 };
|