highcharts-js-rails 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/{highcharts.rb → highcharts-js-rails.rb} +0 -0
- data/lib/highcharts/chart.rb +1 -1
- data/lib/highcharts/version.rb +1 -1
- data/vendor/assets/javascripts/highcharts.js +188 -188
- metadata +14 -14
File without changes
|
data/lib/highcharts/chart.rb
CHANGED
@@ -19,7 +19,7 @@ module Highcharts
|
|
19
19
|
private
|
20
20
|
def render_all
|
21
21
|
content = [render_container, render_titles, render_plot_options, render_axes, render_series, render_legend, render_tooltip].flatten.compact.join(",")
|
22
|
-
if Rails.env.production?
|
22
|
+
if ::Rails.env.production?
|
23
23
|
content
|
24
24
|
else
|
25
25
|
content.gsub(/(,|{|\[)/, "\\1\n").gsub(/(}|\])/, "\n\\1")
|
data/lib/highcharts/version.rb
CHANGED
@@ -497,10 +497,10 @@ function normalizeTickInterval(interval, multiples, magnitude, options) {
|
|
497
497
|
|
498
498
|
/**
|
499
499
|
* Get a normalized tick interval for dates. Returns a configuration object with
|
500
|
-
* unit range (interval), count and name. Used to prepare data for getTimeTicks.
|
500
|
+
* unit range (interval), count and name. Used to prepare data for getTimeTicks.
|
501
501
|
* Previously this logic was part of getTimeTicks, but as getTimeTicks now runs
|
502
|
-
* of segments in stock charts, the normalizing logic was extracted in order to
|
503
|
-
* prevent it for running over again for each segment having the same interval.
|
502
|
+
* of segments in stock charts, the normalizing logic was extracted in order to
|
503
|
+
* prevent it for running over again for each segment having the same interval.
|
504
504
|
* #662, #697.
|
505
505
|
*/
|
506
506
|
function normalizeTimeTickInterval(tickInterval, unitsOption) {
|
@@ -534,7 +534,7 @@ function normalizeTimeTickInterval(tickInterval, unitsOption) {
|
|
534
534
|
multiples = unit[1],
|
535
535
|
count,
|
536
536
|
i;
|
537
|
-
|
537
|
+
|
538
538
|
// loop through the units to find the one that best fits the tickInterval
|
539
539
|
for (i = 0; i < units.length; i++) {
|
540
540
|
unit = units[i];
|
@@ -558,7 +558,7 @@ function normalizeTimeTickInterval(tickInterval, unitsOption) {
|
|
558
558
|
if (interval === timeUnits[YEAR] && tickInterval < 5 * interval) {
|
559
559
|
multiples = [1, 2, 5];
|
560
560
|
}
|
561
|
-
|
561
|
+
|
562
562
|
// prevent 2.5 years intervals, though 25, 250 etc. are allowed
|
563
563
|
if (interval === timeUnits[YEAR] && tickInterval < 5 * interval) {
|
564
564
|
multiples = [1, 2, 5];
|
@@ -566,7 +566,7 @@ function normalizeTimeTickInterval(tickInterval, unitsOption) {
|
|
566
566
|
|
567
567
|
// get the count
|
568
568
|
count = normalizeTickInterval(tickInterval / interval, multiples);
|
569
|
-
|
569
|
+
|
570
570
|
return {
|
571
571
|
unitRange: interval,
|
572
572
|
count: count,
|
@@ -664,7 +664,7 @@ function getTimeTicks(normalizedInterval, min, max, startOfWeek) {
|
|
664
664
|
// else, the interval is fixed and we use simple addition
|
665
665
|
} else {
|
666
666
|
time += interval * count;
|
667
|
-
|
667
|
+
|
668
668
|
// mark new days if the time is dividable by day
|
669
669
|
if (interval <= timeUnits[HOUR] && time % timeUnits[DAY] === 0) {
|
670
670
|
higherRanks[time] = DAY;
|
@@ -673,7 +673,7 @@ function getTimeTicks(normalizedInterval, min, max, startOfWeek) {
|
|
673
673
|
|
674
674
|
i++;
|
675
675
|
}
|
676
|
-
|
676
|
+
|
677
677
|
// push the last time
|
678
678
|
tickPositions.push(time);
|
679
679
|
|
@@ -719,7 +719,7 @@ ChartCounters.prototype = {
|
|
719
719
|
* and not covering the point it self.
|
720
720
|
*/
|
721
721
|
function placeBox(boxWidth, boxHeight, outerLeft, outerTop, outerWidth, outerHeight, point, distance, preferRight) {
|
722
|
-
|
722
|
+
|
723
723
|
// keep the box within the chart area
|
724
724
|
var pointX = point.x,
|
725
725
|
pointY = point.y,
|
@@ -852,7 +852,7 @@ function discardElement(element) {
|
|
852
852
|
}
|
853
853
|
|
854
854
|
/**
|
855
|
-
* Provide error messages for debugging, with links to online explanation
|
855
|
+
* Provide error messages for debugging, with links to online explanation
|
856
856
|
*/
|
857
857
|
function error(code, stop) {
|
858
858
|
var msg = 'Highcharts error #' + code + ': www.highcharts.com/errors/' + code;
|
@@ -1411,7 +1411,7 @@ defaultOptions = {
|
|
1411
1411
|
//valueDecimals: null,
|
1412
1412
|
//xDateFormat: '%A, %b %e, %Y',
|
1413
1413
|
//valuePrefix: '',
|
1414
|
-
//ySuffix: ''
|
1414
|
+
//ySuffix: ''
|
1415
1415
|
//}
|
1416
1416
|
// turboThreshold: 1000
|
1417
1417
|
// zIndex: null
|
@@ -1509,7 +1509,7 @@ defaultOptions = {
|
|
1509
1509
|
},
|
1510
1510
|
|
1511
1511
|
credits: {
|
1512
|
-
enabled:
|
1512
|
+
enabled: true,
|
1513
1513
|
text: 'Highcharts.com',
|
1514
1514
|
href: 'http://www.highcharts.com',
|
1515
1515
|
position: {
|
@@ -1821,15 +1821,15 @@ function setTimeMethods() {
|
|
1821
1821
|
* @param {Object} options The new custom options
|
1822
1822
|
*/
|
1823
1823
|
function setOptions(options) {
|
1824
|
-
|
1825
|
-
// Pull out axis options and apply them to the respective default axis options
|
1824
|
+
|
1825
|
+
// Pull out axis options and apply them to the respective default axis options
|
1826
1826
|
defaultXAxisOptions = merge(defaultXAxisOptions, options.xAxis);
|
1827
1827
|
defaultYAxisOptions = merge(defaultYAxisOptions, options.yAxis);
|
1828
1828
|
options.xAxis = options.yAxis = UNDEFINED;
|
1829
|
-
|
1829
|
+
|
1830
1830
|
// Merge in the default options
|
1831
1831
|
defaultOptions = merge(defaultOptions, options);
|
1832
|
-
|
1832
|
+
|
1833
1833
|
// Apply UTC
|
1834
1834
|
setTimeMethods();
|
1835
1835
|
|
@@ -2190,14 +2190,14 @@ SVGElement.prototype = {
|
|
2190
2190
|
}
|
2191
2191
|
|
2192
2192
|
}
|
2193
|
-
|
2193
|
+
|
2194
2194
|
// Workaround for our #732, WebKit's issue https://bugs.webkit.org/show_bug.cgi?id=78385
|
2195
2195
|
// TODO: If the WebKit team fix this bug before the final release of Chrome 18, remove the workaround.
|
2196
2196
|
if (isWebKit && /Chrome\/(18|19)/.test(userAgent)) {
|
2197
2197
|
if (nodeName === 'text' && (hash.x !== UNDEFINED || hash.y !== UNDEFINED)) {
|
2198
2198
|
var parent = element.parentNode,
|
2199
2199
|
next = element.nextSibling;
|
2200
|
-
|
2200
|
+
|
2201
2201
|
if (parent) {
|
2202
2202
|
parent.removeChild(element);
|
2203
2203
|
if (next) {
|
@@ -2209,7 +2209,7 @@ SVGElement.prototype = {
|
|
2209
2209
|
}
|
2210
2210
|
}
|
2211
2211
|
// End of workaround for #732
|
2212
|
-
|
2212
|
+
|
2213
2213
|
return ret;
|
2214
2214
|
},
|
2215
2215
|
|
@@ -2667,7 +2667,7 @@ SVGElement.prototype = {
|
|
2667
2667
|
// SVG elements
|
2668
2668
|
if (element.namespaceURI === SVG_NS) {
|
2669
2669
|
try { // Fails in Firefox if the container has display: none.
|
2670
|
-
|
2670
|
+
|
2671
2671
|
bBox = element.getBBox ?
|
2672
2672
|
// SVG: use extend because IE9 is not allowed to change width and height in case
|
2673
2673
|
// of rotation (below)
|
@@ -2678,13 +2678,13 @@ SVGElement.prototype = {
|
|
2678
2678
|
height: element.offsetHeight
|
2679
2679
|
};
|
2680
2680
|
} catch (e) {}
|
2681
|
-
|
2681
|
+
|
2682
2682
|
// If the bBox is not set, the try-catch block above failed. The other condition
|
2683
2683
|
// is for Opera that returns a width of -Infinity on hidden elements.
|
2684
2684
|
if (!bBox || bBox.width < 0) {
|
2685
2685
|
bBox = { width: 0, height: 0 };
|
2686
2686
|
}
|
2687
|
-
|
2687
|
+
|
2688
2688
|
width = bBox.width;
|
2689
2689
|
height = bBox.height;
|
2690
2690
|
|
@@ -4195,12 +4195,12 @@ var VMLElementExtension = {
|
|
4195
4195
|
toggleChildren: function (element, visibility) {
|
4196
4196
|
var childNodes = element.childNodes,
|
4197
4197
|
i = childNodes.length;
|
4198
|
-
|
4198
|
+
|
4199
4199
|
while (i--) {
|
4200
|
-
|
4200
|
+
|
4201
4201
|
// apply the visibility
|
4202
4202
|
css(childNodes[i], { visibility: visibility });
|
4203
|
-
|
4203
|
+
|
4204
4204
|
// we have a nested group, apply it to its children again
|
4205
4205
|
if (childNodes[i].nodeName === 'DIV') {
|
4206
4206
|
this.toggleChildren(childNodes[i], visibility);
|
@@ -4329,9 +4329,9 @@ var VMLElementExtension = {
|
|
4329
4329
|
|
4330
4330
|
// width and height
|
4331
4331
|
} else if (key === 'width' || key === 'height') {
|
4332
|
-
|
4332
|
+
|
4333
4333
|
value = mathMax(0, value); // don't set width or height below zero (#311)
|
4334
|
-
|
4334
|
+
|
4335
4335
|
this[key] = value; // used in getter
|
4336
4336
|
|
4337
4337
|
// clipping rectangle special
|
@@ -4721,15 +4721,15 @@ VMLRendererExtension = { // inherit SVGRenderer
|
|
4721
4721
|
(y2 - y1) / // y vector
|
4722
4722
|
(x2 - x1) // x vector
|
4723
4723
|
) * 180 / mathPI;
|
4724
|
-
|
4725
|
-
|
4724
|
+
|
4725
|
+
|
4726
4726
|
// when colors attribute is used, the meanings of opacity and o:opacity2
|
4727
4727
|
// are reversed.
|
4728
4728
|
markup = ['<fill colors="0% ', color1, ',100% ', color2, '" angle="', angle,
|
4729
4729
|
'" opacity="', opacity2, '" o:opacity2="', opacity1,
|
4730
4730
|
'" type="gradient" focus="100%" method="any" />'];
|
4731
4731
|
createElement(this.prepVML(markup), null, null, elem);
|
4732
|
-
|
4732
|
+
|
4733
4733
|
// Gradients are not supported for VML stroke, return the first color. #722.
|
4734
4734
|
} else {
|
4735
4735
|
return stopColor;
|
@@ -5864,7 +5864,7 @@ function Chart(options, callback) {
|
|
5864
5864
|
yDataLength,
|
5865
5865
|
activeYData = [],
|
5866
5866
|
activeCounter = 0;
|
5867
|
-
|
5867
|
+
|
5868
5868
|
// Validate threshold in logarithmic axes
|
5869
5869
|
if (isLog && threshold <= 0) {
|
5870
5870
|
threshold = seriesOptions.threshold = null;
|
@@ -6015,7 +6015,7 @@ function Chart(options, callback) {
|
|
6015
6015
|
*
|
6016
6016
|
*/
|
6017
6017
|
translate = function (val, backwards, cvsCoord, old, handleLog) {
|
6018
|
-
|
6018
|
+
|
6019
6019
|
var sign = 1,
|
6020
6020
|
cvsOffset = 0,
|
6021
6021
|
localA = old ? oldTransA : transA,
|
@@ -6130,28 +6130,28 @@ function Chart(options, callback) {
|
|
6130
6130
|
}
|
6131
6131
|
return tickPositions;
|
6132
6132
|
}
|
6133
|
-
|
6133
|
+
|
6134
6134
|
/**
|
6135
6135
|
* Set the tick positions of a logarithmic axis
|
6136
6136
|
*/
|
6137
6137
|
function getLogTickPositions(interval, min, max, minor) {
|
6138
|
-
|
6138
|
+
|
6139
6139
|
// Since we use this method for both major and minor ticks,
|
6140
6140
|
// use a local variable and return the result
|
6141
|
-
var positions = [];
|
6142
|
-
|
6141
|
+
var positions = [];
|
6142
|
+
|
6143
6143
|
// Reset
|
6144
6144
|
if (!minor) {
|
6145
6145
|
axis._minorAutoInterval = null;
|
6146
6146
|
}
|
6147
|
-
|
6147
|
+
|
6148
6148
|
// First case: All ticks fall on whole logarithms: 1, 10, 100 etc.
|
6149
6149
|
if (interval >= 0.5) {
|
6150
6150
|
interval = mathRound(interval);
|
6151
6151
|
positions = getLinearTickPositions(interval, min, max);
|
6152
|
-
|
6153
|
-
// Second case: We need intermediary ticks. For example
|
6154
|
-
// 1, 2, 4, 6, 8, 10, 20, 40 etc.
|
6152
|
+
|
6153
|
+
// Second case: We need intermediary ticks. For example
|
6154
|
+
// 1, 2, 4, 6, 8, 10, 20, 40 etc.
|
6155
6155
|
} else if (interval >= 0.08) {
|
6156
6156
|
var roundedMin = mathFloor(min),
|
6157
6157
|
intermediate,
|
@@ -6161,7 +6161,7 @@ function Chart(options, callback) {
|
|
6161
6161
|
pos,
|
6162
6162
|
lastPos,
|
6163
6163
|
break2;
|
6164
|
-
|
6164
|
+
|
6165
6165
|
if (interval > 0.3) {
|
6166
6166
|
intermediate = [1, 2, 4];
|
6167
6167
|
} else if (interval > 0.15) { // 0.2 equals five minor ticks per 1, 10, 100 etc
|
@@ -6169,23 +6169,23 @@ function Chart(options, callback) {
|
|
6169
6169
|
} else { // 0.1 equals ten minor ticks per 1, 10, 100 etc
|
6170
6170
|
intermediate = [1, 2, 3, 4, 5, 6, 7, 8, 9];
|
6171
6171
|
}
|
6172
|
-
|
6172
|
+
|
6173
6173
|
for (i = roundedMin; i < max + 1 && !break2; i++) {
|
6174
6174
|
len = intermediate.length;
|
6175
6175
|
for (j = 0; j < len && !break2; j++) {
|
6176
6176
|
pos = log2lin(lin2log(i) * intermediate[j]);
|
6177
|
-
|
6177
|
+
|
6178
6178
|
if (pos > min) {
|
6179
6179
|
positions.push(lastPos);
|
6180
6180
|
}
|
6181
|
-
|
6181
|
+
|
6182
6182
|
if (lastPos > max) {
|
6183
6183
|
break2 = true;
|
6184
6184
|
}
|
6185
6185
|
lastPos = pos;
|
6186
6186
|
}
|
6187
6187
|
}
|
6188
|
-
|
6188
|
+
|
6189
6189
|
// Third case: We are so deep in between whole logarithmic values that
|
6190
6190
|
// we might as well handle the tick positions like a linear axis. For
|
6191
6191
|
// example 1.01, 1.02, 1.03, 1.04.
|
@@ -6196,37 +6196,37 @@ function Chart(options, callback) {
|
|
6196
6196
|
filteredTickIntervalOption = tickIntervalOption === 'auto' ? null : tickIntervalOption,
|
6197
6197
|
tickPixelIntervalOption = options.tickPixelInterval / (minor ? 5 : 1),
|
6198
6198
|
totalPixelLength = minor ? axisLength / tickPositions.length : axisLength;
|
6199
|
-
|
6199
|
+
|
6200
6200
|
interval = pick(
|
6201
6201
|
filteredTickIntervalOption,
|
6202
6202
|
axis._minorAutoInterval,
|
6203
6203
|
(realMax - realMin) * tickPixelIntervalOption / (totalPixelLength || 1)
|
6204
6204
|
);
|
6205
|
-
|
6205
|
+
|
6206
6206
|
interval = normalizeTickInterval(
|
6207
|
-
interval,
|
6208
|
-
null,
|
6207
|
+
interval,
|
6208
|
+
null,
|
6209
6209
|
math.pow(10, mathFloor(math.log(interval) / math.LN10))
|
6210
6210
|
);
|
6211
|
-
|
6211
|
+
|
6212
6212
|
positions = map(getLinearTickPositions(
|
6213
|
-
interval,
|
6213
|
+
interval,
|
6214
6214
|
realMin,
|
6215
|
-
realMax
|
6215
|
+
realMax
|
6216
6216
|
), log2lin);
|
6217
|
-
|
6217
|
+
|
6218
6218
|
if (!minor) {
|
6219
6219
|
axis._minorAutoInterval = interval / 5;
|
6220
6220
|
}
|
6221
6221
|
}
|
6222
|
-
|
6223
|
-
// Set the axis-level tickInterval variable
|
6222
|
+
|
6223
|
+
// Set the axis-level tickInterval variable
|
6224
6224
|
if (!minor) {
|
6225
6225
|
tickInterval = interval;
|
6226
6226
|
}
|
6227
6227
|
return positions;
|
6228
6228
|
}
|
6229
|
-
|
6229
|
+
|
6230
6230
|
/**
|
6231
6231
|
* Return the minor tick positions. For logarithmic axes, reuse the same logic
|
6232
6232
|
* as for major ticks.
|
@@ -6236,27 +6236,27 @@ function Chart(options, callback) {
|
|
6236
6236
|
pos,
|
6237
6237
|
i,
|
6238
6238
|
len;
|
6239
|
-
|
6239
|
+
|
6240
6240
|
if (isLog) {
|
6241
6241
|
len = tickPositions.length;
|
6242
6242
|
for (i = 1; i < len; i++) {
|
6243
6243
|
minorTickPositions = minorTickPositions.concat(
|
6244
6244
|
getLogTickPositions(minorTickInterval, tickPositions[i - 1], tickPositions[i], true)
|
6245
|
-
);
|
6245
|
+
);
|
6246
6246
|
}
|
6247
|
-
|
6248
|
-
} else {
|
6247
|
+
|
6248
|
+
} else {
|
6249
6249
|
for (pos = min + (tickPositions[0] - min) % minorTickInterval; pos <= max; pos += minorTickInterval) {
|
6250
|
-
minorTickPositions.push(pos);
|
6250
|
+
minorTickPositions.push(pos);
|
6251
6251
|
}
|
6252
6252
|
}
|
6253
|
-
|
6253
|
+
|
6254
6254
|
return minorTickPositions;
|
6255
6255
|
}
|
6256
6256
|
|
6257
6257
|
/**
|
6258
|
-
* Adjust the min and max for the minimum range. Keep in mind that the series data is
|
6259
|
-
* not yet processed, so we don't have information on data cropping and grouping, or
|
6258
|
+
* Adjust the min and max for the minimum range. Keep in mind that the series data is
|
6259
|
+
* not yet processed, so we don't have information on data cropping and grouping, or
|
6260
6260
|
* updated axis.pointRange or series.pointRange. The data can't be processed until
|
6261
6261
|
* we have finally established min and max.
|
6262
6262
|
*/
|
@@ -6270,10 +6270,10 @@ function Chart(options, callback) {
|
|
6270
6270
|
loopLength,
|
6271
6271
|
minArgs,
|
6272
6272
|
maxArgs;
|
6273
|
-
|
6273
|
+
|
6274
6274
|
// Set the automatic minimum range based on the closest point distance
|
6275
6275
|
if (isXAxis && minRange === UNDEFINED && !isLog) {
|
6276
|
-
|
6276
|
+
|
6277
6277
|
if (defined(options.min) || defined(options.max)) {
|
6278
6278
|
minRange = null; // don't do this again
|
6279
6279
|
|
@@ -6294,7 +6294,7 @@ function Chart(options, callback) {
|
|
6294
6294
|
minRange = mathMin(closestDataRange * 5, dataMax - dataMin);
|
6295
6295
|
}
|
6296
6296
|
}
|
6297
|
-
|
6297
|
+
|
6298
6298
|
// if minRange is exceeded, adjust
|
6299
6299
|
if (max - min < minRange) {
|
6300
6300
|
|
@@ -6311,7 +6311,7 @@ function Chart(options, callback) {
|
|
6311
6311
|
if (spaceAvailable) { // if space is availabe, stay within the data range
|
6312
6312
|
maxArgs[2] = dataMax;
|
6313
6313
|
}
|
6314
|
-
|
6314
|
+
|
6315
6315
|
max = arrayMin(maxArgs);
|
6316
6316
|
|
6317
6317
|
// now if the max is adjusted, adjust the min back
|
@@ -6395,10 +6395,10 @@ function Chart(options, callback) {
|
|
6395
6395
|
}
|
6396
6396
|
|
6397
6397
|
// Now we're finished detecting min and max, crop and group series data. This
|
6398
|
-
// is in turn needed in order to find tick positions in ordinal axes.
|
6398
|
+
// is in turn needed in order to find tick positions in ordinal axes.
|
6399
6399
|
if (isXAxis && !secondPass) {
|
6400
6400
|
each(axis.series, function (series) {
|
6401
|
-
series.processData(min !== oldMin || max !== oldMax);
|
6401
|
+
series.processData(min !== oldMin || max !== oldMax);
|
6402
6402
|
});
|
6403
6403
|
}
|
6404
6404
|
|
@@ -6409,10 +6409,10 @@ function Chart(options, callback) {
|
|
6409
6409
|
if (axis.beforeSetTickPositions) {
|
6410
6410
|
axis.beforeSetTickPositions();
|
6411
6411
|
}
|
6412
|
-
|
6412
|
+
|
6413
6413
|
// hook for extensions, used in Highstock ordinal axes
|
6414
6414
|
if (axis.postProcessTickInterval) {
|
6415
|
-
tickInterval = axis.postProcessTickInterval(tickInterval);
|
6415
|
+
tickInterval = axis.postProcessTickInterval(tickInterval);
|
6416
6416
|
}
|
6417
6417
|
|
6418
6418
|
// for linear axes, get magnitude and normalize the interval
|
@@ -6450,7 +6450,7 @@ function Chart(options, callback) {
|
|
6450
6450
|
}
|
6451
6451
|
}
|
6452
6452
|
|
6453
|
-
// post process positions, used in ordinal axes in Highstock.
|
6453
|
+
// post process positions, used in ordinal axes in Highstock.
|
6454
6454
|
// TODO: combine with getNonLinearTimeTicks
|
6455
6455
|
fireEvent(axis, 'afterSetTickPositions', {
|
6456
6456
|
tickPositions: tickPositions
|
@@ -6593,14 +6593,14 @@ function Chart(options, callback) {
|
|
6593
6593
|
|
6594
6594
|
userMin = newMin;
|
6595
6595
|
userMax = newMax;
|
6596
|
-
|
6596
|
+
|
6597
6597
|
// redraw
|
6598
6598
|
if (redraw) {
|
6599
6599
|
chart.redraw(animation);
|
6600
6600
|
}
|
6601
6601
|
});
|
6602
6602
|
}
|
6603
|
-
|
6603
|
+
|
6604
6604
|
/**
|
6605
6605
|
* Update translation information
|
6606
6606
|
*/
|
@@ -6609,7 +6609,7 @@ function Chart(options, callback) {
|
|
6609
6609
|
pointRange = 0,
|
6610
6610
|
closestPointRange,
|
6611
6611
|
seriesClosestPointRange;
|
6612
|
-
|
6612
|
+
|
6613
6613
|
// adjust translation for padding
|
6614
6614
|
if (isXAxis) {
|
6615
6615
|
if (isLinked) {
|
@@ -6625,7 +6625,7 @@ function Chart(options, callback) {
|
|
6625
6625
|
}
|
6626
6626
|
});
|
6627
6627
|
}
|
6628
|
-
|
6628
|
+
|
6629
6629
|
// pointRange means the width reserved for each point, like in a column chart
|
6630
6630
|
axis.pointRange = pointRange;
|
6631
6631
|
|
@@ -6687,7 +6687,7 @@ function Chart(options, callback) {
|
|
6687
6687
|
function getThreshold(threshold) {
|
6688
6688
|
var realMin = isLog ? lin2log(min) : min,
|
6689
6689
|
realMax = isLog ? lin2log(max) : max;
|
6690
|
-
|
6690
|
+
|
6691
6691
|
if (realMin > threshold || threshold === null) {
|
6692
6692
|
threshold = realMin;
|
6693
6693
|
} else if (realMax < threshold) {
|
@@ -7034,16 +7034,16 @@ function Chart(options, callback) {
|
|
7034
7034
|
}
|
7035
7035
|
}
|
7036
7036
|
}
|
7037
|
-
|
7037
|
+
|
7038
7038
|
/**
|
7039
7039
|
* Update the axis title by options
|
7040
7040
|
*/
|
7041
7041
|
function setTitle(newTitleOptions, redraw) {
|
7042
7042
|
options.title = merge(options.title, newTitleOptions);
|
7043
|
-
|
7043
|
+
|
7044
7044
|
axisTitle = axisTitle.destroy();
|
7045
7045
|
axis.isDirty = true;
|
7046
|
-
|
7046
|
+
|
7047
7047
|
if (pick(redraw, true)) {
|
7048
7048
|
chart.redraw();
|
7049
7049
|
}
|
@@ -7263,10 +7263,10 @@ function Chart(options, callback) {
|
|
7263
7263
|
s.push((series.tooltipFormatter && series.tooltipFormatter(item)) ||
|
7264
7264
|
item.point.tooltipFormatter(series.tooltipOptions.pointFormat));
|
7265
7265
|
});
|
7266
|
-
|
7266
|
+
|
7267
7267
|
// footer
|
7268
7268
|
s.push(options.footerFormat || '');
|
7269
|
-
|
7269
|
+
|
7270
7270
|
return s.join('');
|
7271
7271
|
}
|
7272
7272
|
|
@@ -8126,7 +8126,7 @@ function Chart(options, callback) {
|
|
8126
8126
|
legendSymbol = item.legendSymbol,
|
8127
8127
|
symbolX,
|
8128
8128
|
checkbox = item.checkbox;
|
8129
|
-
|
8129
|
+
|
8130
8130
|
if (legendItem) {
|
8131
8131
|
legendItem.attr({
|
8132
8132
|
x: ltr ? itemX : legendWidth - itemX,
|
@@ -8294,11 +8294,11 @@ function Chart(options, callback) {
|
|
8294
8294
|
//'stroke-width': 0,
|
8295
8295
|
zIndex: 3
|
8296
8296
|
}).add(legendGroup);
|
8297
|
-
|
8297
|
+
|
8298
8298
|
if (!ltr) {
|
8299
8299
|
symbolX += symbolWidth;
|
8300
8300
|
}
|
8301
|
-
|
8301
|
+
|
8302
8302
|
} else if (itemOptions && itemOptions.marker && itemOptions.marker.enabled) { // draw the marker
|
8303
8303
|
radius = itemOptions.marker.radius;
|
8304
8304
|
legendSymbol = renderer.symbol(
|
@@ -8311,14 +8311,14 @@ function Chart(options, callback) {
|
|
8311
8311
|
.attr(item.pointAttr[NORMAL_STATE])
|
8312
8312
|
.attr({ zIndex: 3 })
|
8313
8313
|
.add(legendGroup);
|
8314
|
-
|
8314
|
+
|
8315
8315
|
if (!ltr) {
|
8316
8316
|
symbolX += symbolWidth / 2;
|
8317
8317
|
}
|
8318
8318
|
|
8319
8319
|
}
|
8320
8320
|
if (legendSymbol) {
|
8321
|
-
|
8321
|
+
|
8322
8322
|
legendSymbol.xOff = symbolX + (strokeWidth % 2 / 2);
|
8323
8323
|
legendSymbol.yOff = symbolY + (strokeWidth % 2 / 2);
|
8324
8324
|
}
|
@@ -8470,8 +8470,8 @@ function Chart(options, callback) {
|
|
8470
8470
|
// hide the border if no items
|
8471
8471
|
box[allItems.length ? 'show' : 'hide']();
|
8472
8472
|
}
|
8473
|
-
|
8474
|
-
// Now that the legend width and height are extablished, put the items in the
|
8473
|
+
|
8474
|
+
// Now that the legend width and height are extablished, put the items in the
|
8475
8475
|
// final position
|
8476
8476
|
each(allItems, positionItem);
|
8477
8477
|
|
@@ -8680,9 +8680,9 @@ function Chart(options, callback) {
|
|
8680
8680
|
|
8681
8681
|
// redraw axes
|
8682
8682
|
each(axes, function (axis) {
|
8683
|
-
fireEvent(axis, 'afterSetExtremes', axis.getExtremes()); // #747, #751
|
8684
|
-
if (axis.isDirty) {
|
8685
|
-
axis.redraw();
|
8683
|
+
fireEvent(axis, 'afterSetExtremes', axis.getExtremes()); // #747, #751
|
8684
|
+
if (axis.isDirty) {
|
8685
|
+
axis.redraw();
|
8686
8686
|
}
|
8687
8687
|
});
|
8688
8688
|
|
@@ -9052,7 +9052,7 @@ function Chart(options, callback) {
|
|
9052
9052
|
if (isString(renderTo)) {
|
9053
9053
|
renderTo = doc.getElementById(renderTo);
|
9054
9054
|
}
|
9055
|
-
|
9055
|
+
|
9056
9056
|
// Display an error if the renderTo is wrong
|
9057
9057
|
if (!renderTo) {
|
9058
9058
|
error(13, true);
|
@@ -9239,11 +9239,11 @@ function Chart(options, callback) {
|
|
9239
9239
|
var width = optionsChart.width || renderTo.offsetWidth,
|
9240
9240
|
height = optionsChart.height || renderTo.offsetHeight,
|
9241
9241
|
target = e.target;
|
9242
|
-
|
9242
|
+
|
9243
9243
|
// Width and height checks for display:none. Target is doc in IE8 and Opera,
|
9244
9244
|
// win in Firefox, Chrome and IE9.
|
9245
9245
|
if (width && height && (target === win || target === doc)) {
|
9246
|
-
|
9246
|
+
|
9247
9247
|
if (width !== containerWidth || height !== containerHeight) {
|
9248
9248
|
clearTimeout(reflowTimeout);
|
9249
9249
|
reflowTimeout = setTimeout(function () {
|
@@ -9899,8 +9899,8 @@ Point.prototype = {
|
|
9899
9899
|
// copy options directly to point
|
9900
9900
|
extend(point, options);
|
9901
9901
|
point.options = options;
|
9902
|
-
|
9903
|
-
// This is the fastest way to detect if there are individual point dataLabels that need
|
9902
|
+
|
9903
|
+
// This is the fastest way to detect if there are individual point dataLabels that need
|
9904
9904
|
// to be considered in drawDataLabels. These can only occur in object configs.
|
9905
9905
|
if (options.dataLabels) {
|
9906
9906
|
series._hasPointLabels = true;
|
@@ -9909,7 +9909,7 @@ Point.prototype = {
|
|
9909
9909
|
point.name = options[0];
|
9910
9910
|
point.y = options[1];
|
9911
9911
|
}
|
9912
|
-
|
9912
|
+
|
9913
9913
|
/*
|
9914
9914
|
* If no x is set by now, get auto incremented value. All points must have an
|
9915
9915
|
* x value, however the y value can be null to create a gap in the series
|
@@ -9918,8 +9918,8 @@ Point.prototype = {
|
|
9918
9918
|
if (point.x === UNDEFINED) {
|
9919
9919
|
point.x = x === UNDEFINED ? series.autoIncrement() : x;
|
9920
9920
|
}
|
9921
|
-
|
9922
|
-
|
9921
|
+
|
9922
|
+
|
9923
9923
|
|
9924
9924
|
},
|
9925
9925
|
|
@@ -10077,23 +10077,23 @@ Point.prototype = {
|
|
10077
10077
|
// loop over the variables defined on the form {series.name}, {point.y} etc
|
10078
10078
|
for (i in match) {
|
10079
10079
|
key = match[i];
|
10080
|
-
|
10081
|
-
if (isString(key) && key !== pointFormat) { // IE matches more than just the variables
|
10080
|
+
|
10081
|
+
if (isString(key) && key !== pointFormat) { // IE matches more than just the variables
|
10082
10082
|
obj = key.indexOf('point') === 1 ? point : series;
|
10083
|
-
|
10084
|
-
if (key === '{point.y}') { // add some preformatting
|
10085
|
-
replacement = (seriesTooltipOptions.valuePrefix || seriesTooltipOptions.yPrefix || '') +
|
10083
|
+
|
10084
|
+
if (key === '{point.y}') { // add some preformatting
|
10085
|
+
replacement = (seriesTooltipOptions.valuePrefix || seriesTooltipOptions.yPrefix || '') +
|
10086
10086
|
numberFormat(point.y, pick(seriesTooltipOptions.valueDecimals, seriesTooltipOptions.yDecimals, originalDecimals)) +
|
10087
10087
|
(seriesTooltipOptions.valueSuffix || seriesTooltipOptions.ySuffix || '');
|
10088
|
-
|
10088
|
+
|
10089
10089
|
} else { // automatic replacement
|
10090
10090
|
replacement = obj[match[i].split(splitter)[1]];
|
10091
10091
|
}
|
10092
|
-
|
10092
|
+
|
10093
10093
|
pointFormat = pointFormat.replace(match[i], replacement);
|
10094
10094
|
}
|
10095
10095
|
}
|
10096
|
-
|
10096
|
+
|
10097
10097
|
return pointFormat;
|
10098
10098
|
},
|
10099
10099
|
|
@@ -10365,7 +10365,7 @@ Series.prototype = {
|
|
10365
10365
|
|
10366
10366
|
series.chart = chart;
|
10367
10367
|
series.options = options = series.setOptions(options); // merge with plotOptions
|
10368
|
-
|
10368
|
+
|
10369
10369
|
// bind the axes
|
10370
10370
|
series.bindAxes();
|
10371
10371
|
|
@@ -10378,7 +10378,7 @@ Series.prototype = {
|
|
10378
10378
|
visible: options.visible !== false, // true by default
|
10379
10379
|
selected: options.selected === true // false by default
|
10380
10380
|
});
|
10381
|
-
|
10381
|
+
|
10382
10382
|
// special
|
10383
10383
|
if (useCanVG) {
|
10384
10384
|
options.animation = false;
|
@@ -10404,9 +10404,9 @@ Series.prototype = {
|
|
10404
10404
|
series.setData(options.data, false);
|
10405
10405
|
|
10406
10406
|
},
|
10407
|
-
|
10408
|
-
|
10409
|
-
|
10407
|
+
|
10408
|
+
|
10409
|
+
|
10410
10410
|
/**
|
10411
10411
|
* Set the xAxis and yAxis properties of cartesian series, and register the series
|
10412
10412
|
* in the axis.series array
|
@@ -10416,31 +10416,31 @@ Series.prototype = {
|
|
10416
10416
|
seriesOptions = series.options,
|
10417
10417
|
chart = series.chart,
|
10418
10418
|
axisOptions;
|
10419
|
-
|
10419
|
+
|
10420
10420
|
if (series.isCartesian) {
|
10421
|
-
|
10421
|
+
|
10422
10422
|
each(['xAxis', 'yAxis'], function (AXIS) { // repeat for xAxis and yAxis
|
10423
|
-
|
10423
|
+
|
10424
10424
|
each(chart[AXIS], function (axis) { // loop through the chart's axis objects
|
10425
|
-
|
10425
|
+
|
10426
10426
|
axisOptions = axis.options;
|
10427
|
-
|
10428
|
-
// apply if the series xAxis or yAxis option mathches the number of the
|
10427
|
+
|
10428
|
+
// apply if the series xAxis or yAxis option mathches the number of the
|
10429
10429
|
// axis, or if undefined, use the first axis
|
10430
10430
|
if ((seriesOptions[AXIS] === axisOptions.index) ||
|
10431
10431
|
(seriesOptions[AXIS] === UNDEFINED && axisOptions.index === 0)) {
|
10432
|
-
|
10432
|
+
|
10433
10433
|
// register this series in the axis.series lookup
|
10434
10434
|
axis.series.push(series);
|
10435
|
-
|
10435
|
+
|
10436
10436
|
// set this series.xAxis or series.yAxis reference
|
10437
10437
|
series[AXIS] = axis;
|
10438
|
-
|
10438
|
+
|
10439
10439
|
// mark dirty for redraw
|
10440
10440
|
axis.isDirty = true;
|
10441
10441
|
}
|
10442
10442
|
});
|
10443
|
-
|
10443
|
+
|
10444
10444
|
});
|
10445
10445
|
}
|
10446
10446
|
},
|
@@ -10475,7 +10475,7 @@ Series.prototype = {
|
|
10475
10475
|
pointsLength = points.length;
|
10476
10476
|
|
10477
10477
|
if (pointsLength) { // no action required for []
|
10478
|
-
|
10478
|
+
|
10479
10479
|
// if connect nulls, just remove null points
|
10480
10480
|
if (series.options.connectNulls) {
|
10481
10481
|
i = pointsLength;
|
@@ -10485,7 +10485,7 @@ Series.prototype = {
|
|
10485
10485
|
}
|
10486
10486
|
}
|
10487
10487
|
segments = [points];
|
10488
|
-
|
10488
|
+
|
10489
10489
|
// else, split on null points
|
10490
10490
|
} else {
|
10491
10491
|
each(points, function (point, i) {
|
@@ -10500,7 +10500,7 @@ Series.prototype = {
|
|
10500
10500
|
});
|
10501
10501
|
}
|
10502
10502
|
}
|
10503
|
-
|
10503
|
+
|
10504
10504
|
// register it
|
10505
10505
|
series.segments = segments;
|
10506
10506
|
},
|
@@ -10523,13 +10523,13 @@ Series.prototype = {
|
|
10523
10523
|
plotOptions.series,
|
10524
10524
|
itemOptions
|
10525
10525
|
);
|
10526
|
-
|
10526
|
+
|
10527
10527
|
// Re-insert the data array to the options and the original config (#717)
|
10528
10528
|
options.data = itemOptions.data = data;
|
10529
|
-
|
10529
|
+
|
10530
10530
|
// the tooltip options are merged between global and series specific options
|
10531
10531
|
series.tooltipOptions = merge(chartOptions.tooltip, options.tooltip);
|
10532
|
-
|
10532
|
+
|
10533
10533
|
return options;
|
10534
10534
|
|
10535
10535
|
},
|
@@ -10552,7 +10552,7 @@ Series.prototype = {
|
|
10552
10552
|
defaultSymbols = chart.options.symbols,
|
10553
10553
|
counters = chart.counters;
|
10554
10554
|
series.symbol = seriesMarkerOption.symbol || defaultSymbols[counters.symbol++];
|
10555
|
-
|
10555
|
+
|
10556
10556
|
// don't substract radius in image symbols (#604)
|
10557
10557
|
if (/^url/.test(series.symbol)) {
|
10558
10558
|
seriesMarkerOption.radius = 0;
|
@@ -10642,11 +10642,11 @@ Series.prototype = {
|
|
10642
10642
|
// reset properties
|
10643
10643
|
series.xIncrement = null;
|
10644
10644
|
series.pointRange = (series.xAxis && series.xAxis.categories && 1) || options.pointRange;
|
10645
|
-
|
10645
|
+
|
10646
10646
|
if (defined(initialColor)) { // reset colors for pie
|
10647
10647
|
chart.counters.color = initialColor;
|
10648
10648
|
}
|
10649
|
-
|
10649
|
+
|
10650
10650
|
// parallel arrays
|
10651
10651
|
var xData = [],
|
10652
10652
|
yData = [],
|
@@ -10660,15 +10660,15 @@ Series.prototype = {
|
|
10660
10660
|
// way. Although the 'for' loops are similar, they are repeated inside each
|
10661
10661
|
// if-else conditional for max performance.
|
10662
10662
|
if (dataLength > turboThreshold) {
|
10663
|
-
|
10663
|
+
|
10664
10664
|
// find the first non-null point
|
10665
10665
|
i = 0;
|
10666
10666
|
while (firstPoint === null && i < dataLength) {
|
10667
10667
|
firstPoint = data[i];
|
10668
10668
|
i++;
|
10669
10669
|
}
|
10670
|
-
|
10671
|
-
|
10670
|
+
|
10671
|
+
|
10672
10672
|
if (isNumber(firstPoint)) { // assume all points are numbers
|
10673
10673
|
var x = pick(options.pointStart, 0),
|
10674
10674
|
pointInterval = pick(options.pointInterval, 1);
|
@@ -10781,7 +10781,7 @@ Series.prototype = {
|
|
10781
10781
|
cropThreshold = options.cropThreshold;
|
10782
10782
|
|
10783
10783
|
// If the series data or axes haven't changed, don't go through this. Return false to pass
|
10784
|
-
// the message on to override methods like in data grouping.
|
10784
|
+
// the message on to override methods like in data grouping.
|
10785
10785
|
if (series.isCartesian && !series.isDirty && !xAxis.isDirty && !series.yAxis.isDirty && !force) {
|
10786
10786
|
return false;
|
10787
10787
|
}
|
@@ -10796,7 +10796,7 @@ Series.prototype = {
|
|
10796
10796
|
if (processedXData[dataLength - 1] < min || processedXData[0] > max) {
|
10797
10797
|
processedXData = [];
|
10798
10798
|
processedYData = [];
|
10799
|
-
|
10799
|
+
|
10800
10800
|
// only crop if it's actually spilling out
|
10801
10801
|
} else if (processedXData[0] < min || processedXData[dataLength - 1] > max) {
|
10802
10802
|
|
@@ -10813,15 +10813,15 @@ Series.prototype = {
|
|
10813
10813
|
cropEnd = i + 1;
|
10814
10814
|
break;
|
10815
10815
|
}
|
10816
|
-
|
10816
|
+
|
10817
10817
|
}
|
10818
10818
|
processedXData = processedXData.slice(cropStart, cropEnd);
|
10819
10819
|
processedYData = processedYData.slice(cropStart, cropEnd);
|
10820
10820
|
cropped = true;
|
10821
10821
|
}
|
10822
10822
|
}
|
10823
|
-
|
10824
|
-
|
10823
|
+
|
10824
|
+
|
10825
10825
|
// Find the closest distance between processed points
|
10826
10826
|
for (i = processedXData.length - 1; i > 0; i--) {
|
10827
10827
|
distance = processedXData[i] - processedXData[i - 1];
|
@@ -10829,18 +10829,18 @@ Series.prototype = {
|
|
10829
10829
|
closestPointRange = distance;
|
10830
10830
|
}
|
10831
10831
|
}
|
10832
|
-
|
10832
|
+
|
10833
10833
|
// Record the properties
|
10834
10834
|
series.cropped = cropped; // undefined or true
|
10835
10835
|
series.cropStart = cropStart;
|
10836
10836
|
series.processedXData = processedXData;
|
10837
10837
|
series.processedYData = processedYData;
|
10838
|
-
|
10838
|
+
|
10839
10839
|
if (options.pointRange === null) { // null means auto, as for columns, candlesticks and OHLC
|
10840
10840
|
series.pointRange = closestPointRange || 1;
|
10841
10841
|
}
|
10842
10842
|
series.closestPointRange = closestPointRange;
|
10843
|
-
|
10843
|
+
|
10844
10844
|
},
|
10845
10845
|
|
10846
10846
|
/**
|
@@ -10886,7 +10886,7 @@ Series.prototype = {
|
|
10886
10886
|
}
|
10887
10887
|
|
10888
10888
|
// Hide cropped-away points - this only runs when the number of points is above cropThreshold, or when
|
10889
|
-
// swithching view from non-grouped data to grouped data (#637)
|
10889
|
+
// swithching view from non-grouped data to grouped data (#637)
|
10890
10890
|
if (data && (processedDataLength !== (dataLength = data.length) || hasGroupedData)) {
|
10891
10891
|
for (i = 0; i < dataLength; i++) {
|
10892
10892
|
if (i === cropStart && !hasGroupedData) { // when has grouped data, clear all points
|
@@ -10924,7 +10924,7 @@ Series.prototype = {
|
|
10924
10924
|
isLastSeries,
|
10925
10925
|
allStackSeries = yAxis.series,
|
10926
10926
|
i = allStackSeries.length;
|
10927
|
-
|
10927
|
+
|
10928
10928
|
// Is it the last visible series?
|
10929
10929
|
while (i--) {
|
10930
10930
|
if (allStackSeries[i].visible) {
|
@@ -10934,7 +10934,7 @@ Series.prototype = {
|
|
10934
10934
|
break;
|
10935
10935
|
}
|
10936
10936
|
}
|
10937
|
-
|
10937
|
+
|
10938
10938
|
// Translate each point
|
10939
10939
|
for (i = 0; i < dataLength; i++) {
|
10940
10940
|
var point = points[i],
|
@@ -10944,7 +10944,7 @@ Series.prototype = {
|
|
10944
10944
|
stack = yAxis.stacks[(yValue < options.threshold ? '-' : '') + series.stackKey],
|
10945
10945
|
pointStack,
|
10946
10946
|
pointStackTotal;
|
10947
|
-
|
10947
|
+
|
10948
10948
|
// get the plotX translation
|
10949
10949
|
point.plotX = mathRound(xAxis.translate(xValue, 0, 0, 0, 1) * 10) / 10; // Math.round fixes #591
|
10950
10950
|
|
@@ -10954,11 +10954,11 @@ Series.prototype = {
|
|
10954
10954
|
pointStackTotal = pointStack.total;
|
10955
10955
|
pointStack.cum = yBottom = pointStack.cum - yValue; // start from top
|
10956
10956
|
yValue = yBottom + yValue;
|
10957
|
-
|
10957
|
+
|
10958
10958
|
if (isLastSeries) {
|
10959
10959
|
yBottom = options.threshold;
|
10960
10960
|
}
|
10961
|
-
|
10961
|
+
|
10962
10962
|
if (stacking === 'percent') {
|
10963
10963
|
yBottom = pointStackTotal ? yBottom * 100 / pointStackTotal : 0;
|
10964
10964
|
yValue = pointStackTotal ? yValue * 100 / pointStackTotal : 0;
|
@@ -10969,10 +10969,10 @@ Series.prototype = {
|
|
10969
10969
|
}
|
10970
10970
|
|
10971
10971
|
// Set translated yBottom or remove it
|
10972
|
-
point.yBottom = defined(yBottom) ?
|
10972
|
+
point.yBottom = defined(yBottom) ?
|
10973
10973
|
yAxis.translate(yBottom, 0, 1, 0, 1) :
|
10974
10974
|
null;
|
10975
|
-
|
10975
|
+
|
10976
10976
|
// general hook, used for Highstock compare mode
|
10977
10977
|
if (hasModifyValue) {
|
10978
10978
|
yValue = series.modifyValue(yValue, point);
|
@@ -11061,7 +11061,7 @@ Series.prototype = {
|
|
11061
11061
|
xDateFormat = tooltipOptions.xDateFormat || '%A, %b %e, %Y',
|
11062
11062
|
xAxis = series.xAxis,
|
11063
11063
|
isDateTime = xAxis && xAxis.options.type === 'datetime';
|
11064
|
-
|
11064
|
+
|
11065
11065
|
return tooltipOptions.headerFormat
|
11066
11066
|
.replace('{point.key}', isDateTime ? dateFormat(xDateFormat, key) : key)
|
11067
11067
|
.replace('{series.name}', series.name)
|
@@ -11388,7 +11388,7 @@ Series.prototype = {
|
|
11388
11388
|
|
11389
11389
|
// remove all events
|
11390
11390
|
removeEvent(series);
|
11391
|
-
|
11391
|
+
|
11392
11392
|
// erase from axes
|
11393
11393
|
each(['xAxis', 'yAxis'], function (AXIS) {
|
11394
11394
|
axis = series[AXIS];
|
@@ -11448,11 +11448,11 @@ Series.prototype = {
|
|
11448
11448
|
* Draw the data labels
|
11449
11449
|
*/
|
11450
11450
|
drawDataLabels: function () {
|
11451
|
-
|
11451
|
+
|
11452
11452
|
var series = this,
|
11453
11453
|
seriesOptions = series.options,
|
11454
11454
|
options = seriesOptions.dataLabels;
|
11455
|
-
|
11455
|
+
|
11456
11456
|
if (options.enabled || series._hasPointLabels) {
|
11457
11457
|
var x,
|
11458
11458
|
y,
|
@@ -11508,55 +11508,55 @@ Series.prototype = {
|
|
11508
11508
|
} else {
|
11509
11509
|
dataLabelsGroup.translate(groupLeft, groupTop);
|
11510
11510
|
}
|
11511
|
-
|
11511
|
+
|
11512
11512
|
// make the labels for each point
|
11513
11513
|
generalOptions = options;
|
11514
11514
|
each(points, function (point) {
|
11515
|
-
|
11515
|
+
|
11516
11516
|
dataLabel = point.dataLabel;
|
11517
|
-
|
11517
|
+
|
11518
11518
|
// Merge in individual options from point
|
11519
11519
|
options = generalOptions; // reset changes from previous points
|
11520
11520
|
pointOptions = point.options;
|
11521
11521
|
if (pointOptions && pointOptions.dataLabels) {
|
11522
11522
|
options = merge(options, pointOptions.dataLabels);
|
11523
11523
|
}
|
11524
|
-
|
11524
|
+
|
11525
11525
|
// If the point is outside the plot area, destroy it. #678
|
11526
11526
|
if (dataLabel && series.isCartesian && !chart.isInsidePlot(point.plotX, point.plotY)) {
|
11527
11527
|
point.dataLabel = dataLabel.destroy();
|
11528
|
-
|
11529
|
-
// Individual labels are disabled if the are explicitly disabled
|
11528
|
+
|
11529
|
+
// Individual labels are disabled if the are explicitly disabled
|
11530
11530
|
// in the point options, or if they fall outside the plot area.
|
11531
11531
|
} else if (options.enabled) {
|
11532
|
-
|
11532
|
+
|
11533
11533
|
// Get the string
|
11534
11534
|
str = options.formatter.call(point.getLabelConfig(), options);
|
11535
|
-
|
11535
|
+
|
11536
11536
|
var barX = point.barX,
|
11537
11537
|
plotX = (barX && barX + point.barW / 2) || point.plotX || -999,
|
11538
11538
|
plotY = pick(point.plotY, -999),
|
11539
11539
|
align = options.align,
|
11540
11540
|
individualYDelta = yIsNull ? (point.y >= 0 ? -6 : 12) : options.y;
|
11541
|
-
|
11541
|
+
|
11542
11542
|
// Postprocess the positions
|
11543
11543
|
x = (inverted ? chart.plotWidth - plotY : plotX) + options.x;
|
11544
11544
|
y = (inverted ? chart.plotHeight - plotX : plotY) + individualYDelta;
|
11545
|
-
|
11545
|
+
|
11546
11546
|
// in columns, align the string to the column
|
11547
11547
|
if (seriesType === 'column') {
|
11548
11548
|
x += { left: -1, right: 1 }[align] * point.barW / 2 || 0;
|
11549
11549
|
}
|
11550
|
-
|
11550
|
+
|
11551
11551
|
if (!stacking && inverted && point.y < 0) {
|
11552
11552
|
align = 'right';
|
11553
11553
|
x -= 10;
|
11554
11554
|
}
|
11555
|
-
|
11555
|
+
|
11556
11556
|
// Determine the color
|
11557
11557
|
options.style.color = pick(options.color, options.style.color, series.color, 'black');
|
11558
|
-
|
11559
|
-
|
11558
|
+
|
11559
|
+
|
11560
11560
|
// update existing label
|
11561
11561
|
if (dataLabel) {
|
11562
11562
|
// vertically centered
|
@@ -11592,12 +11592,12 @@ Series.prototype = {
|
|
11592
11592
|
});
|
11593
11593
|
}
|
11594
11594
|
}
|
11595
|
-
|
11595
|
+
|
11596
11596
|
if (isBarLike && seriesOptions.stacking && dataLabel) {
|
11597
11597
|
var barY = point.barY,
|
11598
11598
|
barW = point.barW,
|
11599
11599
|
barH = point.barH;
|
11600
|
-
|
11600
|
+
|
11601
11601
|
dataLabel.align(options, null,
|
11602
11602
|
{
|
11603
11603
|
x: inverted ? chart.plotWidth - barY - barH : barX,
|
@@ -11606,8 +11606,8 @@ Series.prototype = {
|
|
11606
11606
|
height: inverted ? barW : barH
|
11607
11607
|
});
|
11608
11608
|
}
|
11609
|
-
|
11610
|
-
|
11609
|
+
|
11610
|
+
|
11611
11611
|
}
|
11612
11612
|
});
|
11613
11613
|
}
|
@@ -11688,17 +11688,17 @@ Series.prototype = {
|
|
11688
11688
|
areaSegmentPath.push(L, segmentPath[1], segmentPath[2]);
|
11689
11689
|
}
|
11690
11690
|
if (options.stacking && series.type !== 'areaspline') {
|
11691
|
-
|
11692
|
-
// Follow stack back. Todo: implement areaspline. A general solution could be to
|
11691
|
+
|
11692
|
+
// Follow stack back. Todo: implement areaspline. A general solution could be to
|
11693
11693
|
// reverse the entire graphPath of the previous series, though may be hard with
|
11694
11694
|
// splines and with series with different extremes
|
11695
11695
|
for (i = segment.length - 1; i >= 0; i--) {
|
11696
|
-
|
11696
|
+
|
11697
11697
|
// step line?
|
11698
11698
|
if (i < segment.length - 1 && options.step) {
|
11699
11699
|
areaSegmentPath.push(segment[i + 1].plotX, segment[i].yBottom);
|
11700
11700
|
}
|
11701
|
-
|
11701
|
+
|
11702
11702
|
areaSegmentPath.push(segment[i].plotX, segment[i].yBottom);
|
11703
11703
|
}
|
11704
11704
|
|
@@ -11791,7 +11791,7 @@ Series.prototype = {
|
|
11791
11791
|
chart.clipRect = clipRect;
|
11792
11792
|
}
|
11793
11793
|
}
|
11794
|
-
|
11794
|
+
|
11795
11795
|
|
11796
11796
|
// the group
|
11797
11797
|
if (!series.group) {
|
@@ -12081,8 +12081,8 @@ Series.prototype = {
|
|
12081
12081
|
trackerPath.push(M, singlePoint.plotX - snap, singlePoint.plotY,
|
12082
12082
|
L, singlePoint.plotX + snap, singlePoint.plotY);
|
12083
12083
|
}
|
12084
|
-
|
12085
|
-
|
12084
|
+
|
12085
|
+
|
12086
12086
|
|
12087
12087
|
// draw the tracker
|
12088
12088
|
if (tracker) {
|
@@ -12092,7 +12092,7 @@ Series.prototype = {
|
|
12092
12092
|
group = renderer.g()
|
12093
12093
|
.clip(chart.clipRect)
|
12094
12094
|
.add(chart.trackerGroup);
|
12095
|
-
|
12095
|
+
|
12096
12096
|
series.tracker = renderer.path(trackerPath)
|
12097
12097
|
.attr({
|
12098
12098
|
isTracker: true,
|
@@ -12437,12 +12437,12 @@ var ColumnSeries = extendClass(Series, {
|
|
12437
12437
|
css = cursor && { cursor: cursor },
|
12438
12438
|
group,
|
12439
12439
|
rel;
|
12440
|
-
|
12440
|
+
|
12441
12441
|
// Add a series specific group to allow clipping the trackers
|
12442
12442
|
if (series.isCartesian) {
|
12443
12443
|
group = renderer.g()
|
12444
12444
|
.clip(chart.clipRect)
|
12445
|
-
.add(chart.trackerGroup);
|
12445
|
+
.add(chart.trackerGroup);
|
12446
12446
|
}
|
12447
12447
|
|
12448
12448
|
each(series.points, function (point) {
|
@@ -12514,7 +12514,7 @@ var ColumnSeries = extendClass(Series, {
|
|
12514
12514
|
// start values
|
12515
12515
|
graphic.attr({
|
12516
12516
|
height: 0,
|
12517
|
-
y: defined(threshold) ?
|
12517
|
+
y: defined(threshold) ?
|
12518
12518
|
yAxis.getThreshold(threshold) :
|
12519
12519
|
yAxis.translate(yAxis.getExtremes().min, 0, 1, 0, 1)
|
12520
12520
|
});
|
@@ -12605,10 +12605,10 @@ var ScatterSeries = extendClass(Series, {
|
|
12605
12605
|
while (i--) {
|
12606
12606
|
graphic = points[i].graphic;
|
12607
12607
|
if (graphic) { // doesn't exist for null points
|
12608
|
-
graphic.element._index = i;
|
12608
|
+
graphic.element._index = i;
|
12609
12609
|
}
|
12610
12610
|
}
|
12611
|
-
|
12611
|
+
|
12612
12612
|
// Add the event listeners, we need to do this only once
|
12613
12613
|
if (!series._hasTracking) {
|
12614
12614
|
series.group
|
@@ -12798,7 +12798,7 @@ var PieSeries = extendClass(Series, {
|
|
12798
12798
|
*/
|
12799
12799
|
translate: function () {
|
12800
12800
|
this.generatePoints();
|
12801
|
-
|
12801
|
+
|
12802
12802
|
var total = 0,
|
12803
12803
|
series = this,
|
12804
12804
|
cumulative = -0.25, // start at top
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: highcharts-js-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2012-02-20 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: actionpack
|
16
|
-
requirement: &
|
16
|
+
requirement: &70118123745480 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: '3.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70118123745480
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: railties
|
27
|
-
requirement: &
|
27
|
+
requirement: &70118123744980 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '3.0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70118123744980
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: bundler
|
38
|
-
requirement: &
|
38
|
+
requirement: &70118123744600 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: '0'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70118123744600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: rake
|
49
|
-
requirement: &
|
49
|
+
requirement: &70118123744140 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ! '>='
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: '0'
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70118123744140
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70118123743720 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ! '>='
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: '0'
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70118123743720
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: simplecov
|
71
|
-
requirement: &
|
71
|
+
requirement: &70118123743300 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70118123743300
|
80
80
|
description: Easily configure a Highcharts JS chart for use in a Rails application
|
81
81
|
email:
|
82
82
|
- agrobbin@gmail.com
|
@@ -92,7 +92,7 @@ files:
|
|
92
92
|
- README.md
|
93
93
|
- Rakefile
|
94
94
|
- highcharts-js-rails.gemspec
|
95
|
-
- lib/highcharts.rb
|
95
|
+
- lib/highcharts-js-rails.rb
|
96
96
|
- lib/highcharts/axis.rb
|
97
97
|
- lib/highcharts/base.rb
|
98
98
|
- lib/highcharts/chart.rb
|