Merge remote-tracking branch 'origin/v2.0-dev' into v2.0-dev-tooltip-refactor

This commit is contained in:
etimberg 2015-10-21 20:18:23 -04:00
commit 24e8fe3a4b
16 changed files with 37 additions and 31 deletions

View File

@ -3,6 +3,10 @@ node_js:
- "0.11"
- "0.10"
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
before_script:
- npm install

View File

@ -139,7 +139,7 @@ function unittestTask() {
return gulp.src(files)
.pipe(karma({
configFile: 'karma.conf.js',
configFile: 'karma.conf.ci.js',
action: 'run'
}));
}

7
karma.conf.ci.js Normal file
View File

@ -0,0 +1,7 @@
module.exports = function(config) {
config.set({
browsers: ['Firefox'],
frameworks: ['jasmine'],
reporters: ['progress', 'html'],
});
};

View File

@ -15,6 +15,6 @@
config.type = 'doughnut';
return new Chart(context, config);
}
};
}).call(this);

View File

@ -9,6 +9,6 @@
config.type = 'line';
return new Chart(context, config);
}
};
}).call(this);

View File

@ -15,6 +15,6 @@
config.type = 'polarArea';
return new Chart(context, config);
}
};
}).call(this);

View File

@ -14,6 +14,6 @@
config.type = 'radar';
return new Chart(context, config);
}
};
}).call(this);

View File

@ -34,6 +34,6 @@
config.options = helpers.configMerge(defaultConfig, config.options);
config.type = 'line';
return new Chart(context, config);
}
};
}).call(this);

View File

@ -92,7 +92,7 @@
// Make sure that we handle number of datapoints changing
if (numData < numArcs) {
// Remove excess bars for data points that have been removed
this.getDataset().metaData.splice(numData, numArcs - numData)
this.getDataset().metaData.splice(numData, numArcs - numData);
} else if (numData > numArcs) {
// Add new elements
for (var index = numArcs; index < numData; ++index) {

View File

@ -87,7 +87,7 @@
// Make sure that we handle number of datapoints changing
if (numData < numPoints) {
// Remove excess bars for data points that have been removed
this.getDataset().metaData.splice(numData, numPoints - numData)
this.getDataset().metaData.splice(numData, numPoints - numData);
} else if (numData > numPoints) {
// Add new elements
for (var index = numPoints; index < numData; ++index) {
@ -206,12 +206,4 @@
},
});
return;
Chart.Type.extend({});
}).call(this);

View File

@ -103,7 +103,7 @@
// Make sure that we handle number of datapoints changing
if (numData < numPoints) {
// Remove excess bars for data points that have been removed
this.getDataset().metaData.splice(numData, numPoints - numData)
this.getDataset().metaData.splice(numData, numPoints - numData);
} else if (numData > numPoints) {
// Add new elements
for (var index = numPoints; index < numData; ++index) {

View File

@ -158,7 +158,7 @@
this.scale = scale;
this.scales['radialScale'] = scale;
this.scales.radialScale = scale;
}
Chart.scaleService.update(this, this.chart.width, this.chart.height);
@ -313,13 +313,13 @@
helpers.each(this.data.datasets, function(dataset, datasetIndex) {
if (helpers.isDatasetVisible(dataset)) {
for (var elementIndex = 0; elementIndex < dataset.metaData.length; elementIndex++) {
if (dataset.metaData[elementIndex].inLabelRange(eventPosition.x, eventPosition.y)) {
helpers.each(dataset.metaData, function(element, elementIndex) {
if (element.inLabelRange(eventPosition.x, eventPosition.y)) {
helpers.each(dataset.metaData, function(element, index) {
elementsArray.push(element);
}, this);
}
}
}, this);
}
}, this);
@ -441,8 +441,8 @@
break;
case 'label':
case 'dataset':
for (var i = 0; i < this.active.length; i++) {
this.data.datasets[this.active[i]._datasetIndex].controller.setHoverStyle(this.active[i]);
for (var j = 0; j < this.active.length; j++) {
this.data.datasets[this.active[j]._datasetIndex].controller.setHoverStyle(this.active[j]);
}
break;
default:

View File

@ -114,7 +114,7 @@
// Reset position before calculating rotation
this.top = 0;
this.bottom = this.height
this.bottom = this.height;
}
// Reset padding

View File

@ -45,7 +45,7 @@
// Put into the range of (-PI/2, 3PI/2]
var startAngle = vm.startAngle < (-0.5 * Math.PI) ? vm.startAngle + (2.0 * Math.PI) : vm.startAngle > (1.5 * Math.PI) ? vm.startAngle - (2.0 * Math.PI) : vm.startAngle;
var endAngle = vm.endAngle < (-0.5 * Math.PI) ? vm.endAngle + (2.0 * Math.PI) : vm.endAngle > (1.5 * Math.PI) ? vm.endAngle - (2.0 * Math.PI) : vm.endAngle
var endAngle = vm.endAngle < (-0.5 * Math.PI) ? vm.endAngle + (2.0 * Math.PI) : vm.endAngle > (1.5 * Math.PI) ? vm.endAngle - (2.0 * Math.PI) : vm.endAngle;
//Check if within the range of the open/close angle
var betweenAngles = (pointRelativePosition.angle >= startAngle && pointRelativePosition.angle <= endAngle),

View File

@ -24,23 +24,23 @@
if (this.isHorizontal()) {
var innerWidth = this.width - (this.paddingLeft + this.paddingRight);
var valueWidth = innerWidth / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
var valueOffset = (valueWidth * index) + this.paddingLeft;
var widthOffset = (valueWidth * index) + this.paddingLeft;
if (this.options.gridLines.offsetGridLines && includeOffset) {
valueOffset += (valueWidth / 2);
widthOffset += (valueWidth / 2);
}
return this.left + Math.round(valueOffset);
return this.left + Math.round(widthOffset);
} else {
var innerHeight = this.height - (this.paddingTop + this.paddingBottom);
var valueHeight = innerHeight / Math.max((this.data.labels.length - ((this.options.gridLines.offsetGridLines) ? 0 : 1)), 1);
var valueOffset = (valueHeight * index) + this.paddingTop;
var heightOffset = (valueHeight * index) + this.paddingTop;
if (this.options.gridLines.offsetGridLines && includeOffset) {
valueOffset += (valueHeight / 2);
heightOffset += (valueHeight / 2);
}
return this.top + Math.round(valueOffset);
return this.top + Math.round(heightOffset);
}
},
});

View File

@ -1396,6 +1396,9 @@ describe('Linear Scale', function() {
}, {
"name": "rotate",
"args": [-1.5707963267948966]
}, {
"name": "setFillStyle",
"args": ["#666"]
}, {
"name": "setFillStyle",
"args": ["#666"]