config.type = 'doughnut';
return new Chart(context, config);
- }
+ };
}).call(this);
config.type = 'line';
return new Chart(context, config);
- }
+ };
}).call(this);
config.type = 'polarArea';
return new Chart(context, config);
- }
+ };
}).call(this);
config.type = 'radar';
return new Chart(context, config);
- }
+ };
}).call(this);
config.options = helpers.configMerge(defaultConfig, config.options);
config.type = 'line';
return new Chart(context, config);
- }
+ };
}).call(this);
\ No newline at end of file
// 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) {
// 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) {
},
});
-
-
-
- return;
-
-
- Chart.Type.extend({});
-
}).call(this);
// 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) {
this.scale = scale;
- this.scales['radialScale'] = scale;
+ this.scales.radialScale = scale;
}
Chart.scaleService.update(this, this.chart.width, this.chart.height);
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);
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:
base[key].push(helpers.configMerge(valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj));
} else if (valueObj.type !== base[key][index].type) {
// Type changed. Bring in the new defaults before we bring in valueObj so that valueObj can override the correct scale defaults
- base[key][index] = helpers.configMerge(base[key][index], valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj)
+ base[key][index] = helpers.configMerge(base[key][index], valueObj.type ? Chart.scaleService.getScaleDefaults(valueObj.type) : {}, valueObj);
} else {
// Type is the same
base[key][index] = helpers.configMerge(base[key][index], valueObj);
},
log10 = helpers.log10 = function(x) {
if (Math.log10) {
- return Math.log10(x)
+ return Math.log10(x);
} else {
return Math.log(x) / Math.LN10;
}
// can use classlist
hiddenIframe.classlist.add(hiddenIframeClass);
} else {
- hiddenIframe.setAttribute('class', hiddenIframeClass)
+ hiddenIframe.setAttribute('class', hiddenIframeClass);
}
// Set the style
if (callback) {
callback();
}
- }
+ };
},
removeResizeListener = helpers.removeResizeListener = function(node) {
var hiddenIframe = node.querySelector('.chartjs-hidden-iframe');
// Reset position before calculating rotation
this.top = 0;
- this.bottom = this.height
+ this.bottom = this.height;
}
// Reset padding
// 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),
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);
}
},
});