forked from highcharts/highcharts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
patch.patch
375 lines (353 loc) · 12.8 KB
/
patch.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
From 06fea98c500094cae098d02429c1393979326424 Mon Sep 17 00:00:00 2001
From: Taha Jahangir <mtjahangir@gmail.com>
Date: Wed, 23 Jul 2014 10:55:26 +0430
Subject: [PATCH] Always use `numberFormat` function via
`Highcharts.numberFormat` to allow overriding `numberFormat` completely
---
js/highcharts.src.js | 12 ++++++------
js/highmaps.src.js | 16 ++++++++--------
js/highstock.src.js | 14 +++++++-------
js/modules/heatmap.src.js | 5 ++---
js/modules/map.src.js | 5 ++---
js/parts-map/ColorAxis.js | 4 ++--
js/parts-map/Globals.js | 1 -
js/parts-map/HeatmapGlobals.js | 1 -
js/parts/Axis.js | 8 ++++----
js/parts/Options.js | 2 +-
js/parts/StockChart.js | 2 +-
js/parts/Utilities.js | 2 +-
12 files changed, 34 insertions(+), 38 deletions(-)
diff --git a/js/highcharts.src.js b/js/highcharts.src.js
index 9cc84be..a170051 100644
--- a/js/highcharts.src.js
+++ b/js/highcharts.src.js
@@ -486,7 +486,7 @@ function formatSingle(format, val) {
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
- val = numberFormat(
+ val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,
@@ -1388,7 +1388,7 @@ defaultOptions = {
//defer: true,
enabled: false,
formatter: function () {
- return this.y === null ? '' : numberFormat(this.y, -1);
+ return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
verticalAlign: 'bottom', // above singular point
y: 0
@@ -6344,7 +6344,7 @@ Axis.prototype = {
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
- return numberFormat(this.total, -1);
+ return Highcharts.numberFormat(this.total, -1);
},
style: defaultLabelOptions.style
}
@@ -6615,17 +6615,17 @@ Axis.prototype = {
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
- ret = numberFormat(value / multi, -1) + numericSymbols[i];
+ ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
- ret = numberFormat(value, 0);
+ ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
- ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
+ ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
diff --git a/js/highmaps.src.js b/js/highmaps.src.js
index 71ebc1e..72ada82 100644
--- a/js/highmaps.src.js
+++ b/js/highmaps.src.js
@@ -486,7 +486,7 @@ function formatSingle(format, val) {
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
- val = numberFormat(
+ val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,
@@ -1388,7 +1388,7 @@ defaultOptions = {
//defer: true,
enabled: false,
formatter: function () {
- return this.y === null ? '' : numberFormat(this.y, -1);
+ return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
verticalAlign: 'bottom', // above singular point
y: 0
@@ -6079,7 +6079,7 @@ Axis.prototype = {
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
- return numberFormat(this.total, -1);
+ return Highcharts.numberFormat(this.total, -1);
},
style: defaultLabelOptions.style
}
@@ -6350,17 +6350,17 @@ Axis.prototype = {
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
- ret = numberFormat(value / multi, -1) + numericSymbols[i];
+ ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
- ret = numberFormat(value, 0);
+ ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
- ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
+ ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
@@ -15621,13 +15621,13 @@ extend(ColorAxis.prototype, {
name = '> ';
}
if (from !== UNDEFINED) {
- name += numberFormat(from, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== UNDEFINED && to !== UNDEFINED) {
name += ' - ';
}
if (to !== UNDEFINED) {
- name += numberFormat(to, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
diff --git a/js/highstock.src.js b/js/highstock.src.js
index ded4e54..bf497ac 100644
--- a/js/highstock.src.js
+++ b/js/highstock.src.js
@@ -486,7 +486,7 @@ function formatSingle(format, val) {
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
- val = numberFormat(
+ val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,
@@ -1388,7 +1388,7 @@ defaultOptions = {
//defer: true,
enabled: false,
formatter: function () {
- return this.y === null ? '' : numberFormat(this.y, -1);
+ return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
verticalAlign: 'bottom', // above singular point
y: 0
@@ -6344,7 +6344,7 @@ Axis.prototype = {
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
- return numberFormat(this.total, -1);
+ return Highcharts.numberFormat(this.total, -1);
},
style: defaultLabelOptions.style
}
@@ -6615,17 +6615,17 @@ Axis.prototype = {
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
- ret = numberFormat(value / multi, -1) + numericSymbols[i];
+ ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
- ret = numberFormat(value, 0);
+ ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
- ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
+ ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
@@ -21922,7 +21922,7 @@ Point.prototype.tooltipFormatter = function (pointFormat) {
pointFormat = pointFormat.replace(
'{point.change}',
- (point.change > 0 ? '+' : '') + numberFormat(point.change, pick(point.series.tooltipOptions.changeDecimals, 2))
+ (point.change > 0 ? '+' : '') + Highcharts.numberFormat(point.change, pick(point.series.tooltipOptions.changeDecimals, 2))
);
return pointTooltipFormatter.apply(this, [pointFormat]);
diff --git a/js/modules/heatmap.src.js b/js/modules/heatmap.src.js
index 921c71e..a2411c0 100644
--- a/js/modules/heatmap.src.js
+++ b/js/modules/heatmap.src.js
@@ -25,7 +25,6 @@ var UNDEFINED,
extendClass = Highcharts.extendClass,
merge = Highcharts.merge,
pick = Highcharts.pick,
- numberFormat = Highcharts.numberFormat,
seriesTypes = Highcharts.seriesTypes,
wrap = Highcharts.wrap,
noop = function () {};
@@ -404,13 +403,13 @@ extend(ColorAxis.prototype, {
name = '> ';
}
if (from !== UNDEFINED) {
- name += numberFormat(from, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== UNDEFINED && to !== UNDEFINED) {
name += ' - ';
}
if (to !== UNDEFINED) {
- name += numberFormat(to, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
diff --git a/js/modules/map.src.js b/js/modules/map.src.js
index 040667c..07c4ef6 100644
--- a/js/modules/map.src.js
+++ b/js/modules/map.src.js
@@ -30,7 +30,6 @@ var UNDEFINED,
extendClass = Highcharts.extendClass,
merge = Highcharts.merge,
pick = Highcharts.pick,
- numberFormat = Highcharts.numberFormat,
defaultOptions = Highcharts.getOptions(),
seriesTypes = Highcharts.seriesTypes,
defaultPlotOptions = defaultOptions.plotOptions,
@@ -505,13 +504,13 @@ extend(ColorAxis.prototype, {
name = '> ';
}
if (from !== UNDEFINED) {
- name += numberFormat(from, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== UNDEFINED && to !== UNDEFINED) {
name += ' - ';
}
if (to !== UNDEFINED) {
- name += numberFormat(to, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
diff --git a/js/parts-map/ColorAxis.js b/js/parts-map/ColorAxis.js
index f332546..55b48aa 100644
--- a/js/parts-map/ColorAxis.js
+++ b/js/parts-map/ColorAxis.js
@@ -372,13 +372,13 @@ extend(ColorAxis.prototype, {
name = '> ';
}
if (from !== UNDEFINED) {
- name += numberFormat(from, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(from, valueDecimals) + valueSuffix;
}
if (from !== UNDEFINED && to !== UNDEFINED) {
name += ' - ';
}
if (to !== UNDEFINED) {
- name += numberFormat(to, valueDecimals) + valueSuffix;
+ name += Highcharts.numberFormat(to, valueDecimals) + valueSuffix;
}
// Add a mock object to the legend items
diff --git a/js/parts-map/Globals.js b/js/parts-map/Globals.js
index e5037e2..ea8a28c 100644
--- a/js/parts-map/Globals.js
+++ b/js/parts-map/Globals.js
@@ -18,7 +18,6 @@ var UNDEFINED,
extendClass = Highcharts.extendClass,
merge = Highcharts.merge,
pick = Highcharts.pick,
- numberFormat = Highcharts.numberFormat,
defaultOptions = Highcharts.getOptions(),
seriesTypes = Highcharts.seriesTypes,
defaultPlotOptions = defaultOptions.plotOptions,
diff --git a/js/parts-map/HeatmapGlobals.js b/js/parts-map/HeatmapGlobals.js
index 18ea5fe..9953a92 100644
--- a/js/parts-map/HeatmapGlobals.js
+++ b/js/parts-map/HeatmapGlobals.js
@@ -14,7 +14,6 @@ var UNDEFINED,
extendClass = Highcharts.extendClass,
merge = Highcharts.merge,
pick = Highcharts.pick,
- numberFormat = Highcharts.numberFormat,
seriesTypes = Highcharts.seriesTypes,
wrap = Highcharts.wrap,
noop = function () {};
diff --git a/js/parts/Axis.js b/js/parts/Axis.js
index 45f7a6b..de6c67c 100644
--- a/js/parts/Axis.js
+++ b/js/parts/Axis.js
@@ -120,7 +120,7 @@ Axis.prototype = {
//textAlign: dynamic,
//rotation: 0,
formatter: function () {
- return numberFormat(this.total, -1);
+ return Highcharts.numberFormat(this.total, -1);
},
style: defaultLabelOptions.style
}
@@ -391,17 +391,17 @@ Axis.prototype = {
while (i-- && ret === UNDEFINED) {
multi = Math.pow(1000, i + 1);
if (numericSymbolDetector >= multi && numericSymbols[i] !== null) {
- ret = numberFormat(value / multi, -1) + numericSymbols[i];
+ ret = Highcharts.numberFormat(value / multi, -1) + numericSymbols[i];
}
}
}
if (ret === UNDEFINED) {
if (mathAbs(value) >= 10000) { // add thousands separators
- ret = numberFormat(value, 0);
+ ret = Highcharts.numberFormat(value, 0);
} else { // small numbers
- ret = numberFormat(value, -1, UNDEFINED, ''); // #2466
+ ret = Highcharts.numberFormat(value, -1, UNDEFINED, ''); // #2466
}
}
diff --git a/js/parts/Options.js b/js/parts/Options.js
index 7a74c58..5778555 100644
--- a/js/parts/Options.js
+++ b/js/parts/Options.js
@@ -159,7 +159,7 @@ defaultOptions = {
//defer: true,
enabled: false,
formatter: function () {
- return this.y === null ? '' : numberFormat(this.y, -1);
+ return this.y === null ? '' : Highcharts.numberFormat(this.y, -1);
},
verticalAlign: 'bottom', // above singular point
y: 0
diff --git a/js/parts/StockChart.js b/js/parts/StockChart.js
index c5293f6..8893a75 100644
--- a/js/parts/StockChart.js
+++ b/js/parts/StockChart.js
@@ -527,7 +527,7 @@ Point.prototype.tooltipFormatter = function (pointFormat) {
pointFormat = pointFormat.replace(
'{point.change}',
- (point.change > 0 ? '+' : '') + numberFormat(point.change, pick(point.series.tooltipOptions.changeDecimals, 2))
+ (point.change > 0 ? '+' : '') + Highcharts.numberFormat(point.change, pick(point.series.tooltipOptions.changeDecimals, 2))
);
return pointTooltipFormatter.apply(this, [pointFormat]);
diff --git a/js/parts/Utilities.js b/js/parts/Utilities.js
index c36f889..8466277 100644
--- a/js/parts/Utilities.js
+++ b/js/parts/Utilities.js
@@ -378,7 +378,7 @@ function formatSingle(format, val) {
decimals = format.match(decRegex);
decimals = decimals ? decimals[1] : -1;
if (val !== null) {
- val = numberFormat(
+ val = Highcharts.numberFormat(
val,
decimals,
lang.decimalPoint,