src/main/webapp/Highcharts-5.0.12/code/js/modules/overlapping-datalabels.src.js
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/**
* @license Highcharts JS v5.0.12 (2017-05-24)
*
* (c) 2009-2017 Torstein Honsi
*
* License: www.highcharts.com/license
*/
'use strict';
(function(factory) {
if (typeof module === 'object' && module.exports) {
module.exports = factory;
} else {
factory(Highcharts);
}
}(function(Highcharts) {
(function(H) {
/**
* (c) 2009-2017 Torstein Honsi
*
* License: www.highcharts.com/license
*/
/**
* Highcharts module to hide overlapping data labels. This module is included in
* Highcharts.
*/
var Chart = H.Chart,
each = H.each,
pick = H.pick,
addEvent = H.addEvent;
// Collect potensial overlapping data labels. Stack labels probably don't need
// to be considered because they are usually accompanied by data labels that lie
// inside the columns.
Chart.prototype.callbacks.push(function(chart) {
function collectAndHide() {
var labels = [];
each(chart.series || [], function(series) {
var dlOptions = series.options.dataLabels,
// Range series have two collections
collections = series.dataLabelCollections || ['dataLabel'];
if (
(dlOptions.enabled || series._hasPointLabels) &&
!dlOptions.allowOverlap &&
series.visible
) { // #3866
each(collections, function(coll) {
each(series.points, function(point) {
if (point[coll]) {
point[coll].labelrank = pick(
point.labelrank,
point.shapeArgs && point.shapeArgs.height
); // #4118
labels.push(point[coll]);
}
});
});
}
});
后面还有 127 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。