language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
chartjs
Chart.js
8d5b3809f6a607ebf2be7af40fb538ea5e42c4db.json
Fix global font settings
test/scale.radialLinear.tests.js
@@ -28,18 +28,11 @@ describe('Test the radial linear scale', function() { }, lineArc: false, pointLabels: { - fontColor: "#666", - fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", fontSize: 10, - fontStyle: "normal", callback: defaultConfig.pointLabels.callback, // make t...
true
Other
chartjs
Chart.js
8d5b3809f6a607ebf2be7af40fb538ea5e42c4db.json
Fix global font settings
test/scale.time.tests.js
@@ -27,19 +27,11 @@ describe('Time scale tests', function() { }, position: "bottom", scaleLabel: { - fontColor: '#666', - fontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", - fontSize: 12, - fontStyle: 'normal', labelString: '', display: false, }, ticks: { b...
true
Other
chartjs
Chart.js
33a1fa928ddb15ae88ee6cb3dbb66ddc8ab6e8c6.json
fix consistency with other samples
samples/bubble.html
@@ -6,7 +6,7 @@ <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="../dist/Chart.bundle.js"></script> <style type="text/css"> - #canvas{ + canvas{ -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none; ...
true
Other
chartjs
Chart.js
33a1fa928ddb15ae88ee6cb3dbb66ddc8ab6e8c6.json
fix consistency with other samples
samples/line.html
@@ -6,7 +6,7 @@ <script src="../dist/Chart.bundle.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <style> - #canvas{ + canvas{ -moz-user-select: none; -webkit-user-select: none; -ms-user-select: none;
true
Other
chartjs
Chart.js
2977c8eb9c901d2cc6f54ba0f5a56adf04754195.json
improve doughnut sample - set title - set same size canvas as other samples - remove user select from canvas - remove html legend - remove logs
samples/doughnut.html
@@ -6,32 +6,23 @@ <script src="../dist/Chart.bundle.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <style> - body { - padding: 0; - margin: 0; - } - - #canvas-holder { - width: 30%; + canvas { + -moz-user-...
false
Other
chartjs
Chart.js
a4fa956ab4ee941c8d104adf80cb0ef2117e3bf0.json
improve scatter sample - set title - set same size canvas as other samples - remove user select from canvas
samples/scatter.html
@@ -5,12 +5,19 @@ <title>Scatter Chart</title> <script src="../dist/Chart.bundle.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> + <style> + canvas { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select:...
false
Other
chartjs
Chart.js
0985e6d56491115b46c2d956aa718fefbd83b017.json
improve bar sample - set title - set same size canvas as other samples - remove user select from canvas - remove html legend - fix x-axis labels when adding data
samples/bar.html
@@ -5,29 +5,27 @@ <title>Bar Chart</title> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="../dist/Chart.bundle.js"></script> - <style type="text/css"> - canvas { - border: 1px solid red; - } + <style> + canvas { + ...
false
Other
chartjs
Chart.js
428567d8cf376fb4bd6352654136a113ebee2d46.json
improve radar sample - improve title - set same size canvas as other samples - remove user select from canvas - remove html legend
samples/radar.html
@@ -5,23 +5,24 @@ <title>Radar Chart</title> <script src="../dist/Chart.bundle.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> + <style> + canvas { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: n...
false
Other
chartjs
Chart.js
4729b05cc108977014366cc7e76346d7c9532def.json
improve line chart sample - set title for chart - remove html legend - set same size canvas as other samples - remove user select from canvas
samples/line.html
@@ -6,15 +6,17 @@ <script src="../dist/Chart.bundle.js"></script> <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <style> - canvas { - -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, .5); - } + #canvas{ + -moz-user-select: none; + ...
false
Other
chartjs
Chart.js
f5a2e394c86df31b6baf47cf22a1e3ac9194bd5c.json
Fix radius 0
src/elements/element.point.js
@@ -60,14 +60,14 @@ module.exports = function(Chart) { return; } - if (vm.radius > 0 || vm.borderWidth > 0) { + if (!isNaN(vm.radius) && vm.radius > 0) { ctx.strokeStyle = vm.borderColor || Chart.defaults.global.defaultColor; - ctx.lineWidth = vm.borderWidth || Chart.defaults.global.elements.po...
false
Other
chartjs
Chart.js
8d6209271be212718fce28df241c960556a55ab6.json
Add link to slack invite
README.md
@@ -2,7 +2,7 @@ # Chart.js -[![Build Status](https://travis-ci.org/nnnick/Chart.js.svg?branch=master)](https://travis-ci.org/nnnick/Chart.js) [![Code Climate](https://codeclimate.com/github/nnnick/Chart.js/badges/gpa.svg)](https://codeclimate.com/github/nnnick/Chart.js) +[![Build Status](https://travis-ci.org/nnn...
false
Other
chartjs
Chart.js
111ada730cd69452e5c8303c72f4b50063b4474a.json
Fix typo in docs. Fixes #1042
docs/06-Advanced.md
@@ -96,7 +96,7 @@ var myPieChart = new Chart(ctx).Pie(data, { // tooltip.y // etc... - }; + } }); ```
false
Other
chartjs
Chart.js
4f4f804a7180e8b0a43ee4c551479a540a271c26.json
Use a named define to fix #768
src/Chart.Core.js
@@ -2233,7 +2233,7 @@ if (amd) { - define(function(){ + define('Chart', [], function(){ return Chart; }); } else if (typeof module === 'object' && module.exports) {
false
Other
chartjs
Chart.js
ef1acfa0e85f5b2d5aca473eb5027b91f89d6fb1.json
Build single scales in core
src/core/core.controller.js
@@ -121,6 +121,20 @@ this.scales[scale.id] = scale; }, this); } + + if (this.options.scale) { + // Build radial axes + var ScaleClass = Chart.scaleService.getScaleConstructor(axisOptions.type); + var scale = new ScaleClass({ + ctx: this.chart.ctx, + options: axisOptions, + ...
false
Other
chartjs
Chart.js
fa1b0db453c679320d97513692cf1aac4819da02.json
Apply correct hover styles
src/core/core.controller.js
@@ -331,7 +331,7 @@ break; case 'label': for (var i = 0; i < this.lastActive.length; i++) { - this.data.datasets[this.lastActive[0]._datasetIndex].controller.removeHoverStyle(this.lastActive[i], this.lastActive[i]._datasetIndex, this.lastActive[i]._index); + this.data.datasets[this.lastA...
false
Other
chartjs
Chart.js
22c40fe752fd6754ba16963c3af7ac235eeb3f0e.json
Fix 2 bar samples
samples/bar-multi-axis.html
@@ -45,7 +45,8 @@ }; window.onload = function() { var ctx = document.getElementById("canvas").getContext("2d"); - window.myBar = new Chart(ctx).Bar({ + window.myBar = new Chart(ctx, { + type: 'bar', data: barChartData, options: { re...
true
Other
chartjs
Chart.js
22c40fe752fd6754ba16963c3af7ac235eeb3f0e.json
Fix 2 bar samples
samples/bar-stacked.html
@@ -39,7 +39,8 @@ }; window.onload = function() { var ctx = document.getElementById("canvas").getContext("2d"); - window.myBar = new Chart(ctx).Bar({ + window.myBar = new Chart(ctx, { + type: 'bar', data: barChartData, options: { res...
true
Other
chartjs
Chart.js
d3538a1fbde0d0468f123531dd92eae215d75bd3.json
use inLabelRange when tooltips are in label mode
src/core/core.controller.js
@@ -223,7 +223,7 @@ helpers.each(this.data.datasets, function(dataset, datasetIndex) { helpers.each(dataset.metaData, function(element, index) { - if (element.inRange(eventPosition.x, eventPosition.y)) { + if (element.inLabelRange(eventPosition.x, eventPosition.y)) { elementsArray.push(element...
false
Other
chartjs
Chart.js
b21061c164e265490fe3eb80df266cc62b334044.json
Remove hover styles
src/controllers/controller.bar.js
@@ -128,8 +128,6 @@ }, this); }, - - setHoverStyle: function(rectangle) { var dataset = this.chart.data.datasets[rectangle._datasetIndex]; var index = rectangle._index; @@ -140,7 +138,12 @@ }, removeHoverStyle: function(rectangle) { - // TODO + var dataset = this.chart.data.datasets[rect...
true
Other
chartjs
Chart.js
b21061c164e265490fe3eb80df266cc62b334044.json
Remove hover styles
src/controllers/controller.line.js
@@ -215,7 +215,13 @@ }, removeHoverStyle: function(point) { - // TODO + var dataset = this.chart.data.datasets[point._datasetIndex]; + var index = point._index; + + point._model.radius = point.custom && point.custom.radius ? point.custom.radius : helpers.getValueAtIndexOrDefault(this.getDataset().radius...
true
Other
chartjs
Chart.js
81c66c8d8549a458518a6534ae3e81c5c496fe85.json
Fix duplicate property
src/scales/scale.linear.js
@@ -37,7 +37,6 @@ }; var LinearScale = Chart.Element.extend({ - calculateRange: helpers.noop, // overridden in the chart. Will set min and max as properties of the scale for later use isHorizontal: function() { return this.options.position == "top" || this.options.position == "bottom"; },
false
Other
chartjs
Chart.js
ecd3b58b281cf604ad871f91f167d4374e5cc75e.json
Fix typo in linear scale.
src/scales/scale.linear.js
@@ -133,7 +133,7 @@ if (this.options.labels.userCallback) { // If the user provided a callback for label generation, use that as first priority - label = this.options.lables.userCallback(tick, index, ticks); + label = this.options.labels.userCallback(tick, index, ticks); } else if (this.option...
false
Other
chartjs
Chart.js
98253fea5d0e2ecc1dcdad6321e5bf3137fd7ae2.json
Fix some bugs in the animation stuff
src/Chart.Core.js
@@ -948,7 +948,7 @@ var stepDecimal = animationObject.currentStep / animationObject.numSteps; var easeDecimal = easingFunction(stepDecimal); - chartInstance.draw(chartInstance, easeDecimal, stepDecimal, currentStep); + chartInstance.draw(easeDecimal, stepDecimal, animationObject.currentStep);...
false
Other
chartjs
Chart.js
9a13dd78fc6a37e5239fabd428973bdfd5a8f8a0.json
Fix a typo
src/Chart.Core.js
@@ -2093,7 +2093,7 @@ }); // If there are no animations queued, manually kickstart a digest, for lack of a better word - if(!this.animations.length){ + if (this.animations.length) { helpers.requestAnimFrame(this.startDigest); } },
false
Other
chartjs
Chart.js
3e59438646382d66b2b1313731f237f43c4cc9dc.json
Integrate animation service with chart
src/Chart.Core.js
@@ -2076,9 +2076,9 @@ Chart.animationService = { animations: [], - addAnimation: function(chart, animationObject) { + addAnimation: function(chartInstance, animationObject) { for (var index = 0; index < this.animations.length; ++ index){ - if (this.animations[index].chart === chart){ + if (this.anima...
false
Other
chartjs
Chart.js
2677360f4bcda5109664c6f2fc93378f46f82760.json
Add offsetGridLines option to Line charts
docs/01-Line-Chart.md
@@ -102,6 +102,9 @@ These are the customisation options specific to Line charts. These options are m //String - A legend template legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(da...
true
Other
chartjs
Chart.js
2677360f4bcda5109664c6f2fc93378f46f82760.json
Add offsetGridLines option to Line charts
src/Chart.Line.js
@@ -50,7 +50,10 @@ datasetFill : true, //String - A legend template - legendTemplate : "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].strokeColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%...
true
Other
chartjs
Chart.js
47d23601b1e3cfc18c7a661ff56c4545c8e6a29d.json
Fix CodeClimate issues
gulpfile.js
@@ -24,11 +24,11 @@ var srcDir = './src/'; gulp.task('build', function(){ // Default to all of the chart types, with Chart.Core first - var srcFiles = [FileName('Core')], + var srcFiles = [new FileName('Core')], isCustom = !!(util.env.types), outputDir = (isCustom) ? 'custom' : '.'; if (isCustom){ - util....
true
Other
chartjs
Chart.js
47d23601b1e3cfc18c7a661ff56c4545c8e6a29d.json
Fix CodeClimate issues
src/Chart.Core.js
@@ -35,7 +35,7 @@ { return document.defaultView.getComputedStyle(element).getPropertyValue(dimension); } - } + }; var width = this.width = computeDimension(context.canvas,'Width') || context.canvas.width; var height = this.height = computeDimension(context.canvas,'Height') || context.canvas.heigh...
true
Other
chartjs
Chart.js
de564326b098583bf4edd95d698d6c97a8e612b3.json
Target src files from #142
src/Chart.Core.js
@@ -25,6 +25,25 @@ this.ctx = context; //Variables global to the chart + var computeDimension = function(element,dimension) + { + if (element['offset'+dimension]) + { + return element['offset'+dimension]; + } + else + { + return document.defaultView.getComputedStyle(element).getPropertyValue(d...
false
Other
chartjs
Chart.js
2d28075cdeee07fbfaf045cf00f2db0bc755d7a6.json
ADD GH PR guidelines
CONTRIBUTING.md
@@ -33,7 +33,7 @@ Please provide any additional details associated with the bug, if it's browser o Pull requests ------------- -Clear, concise pull requests are excellent at continuing the project's community driven growth. But please review the guidelines below before starting work on the project. +Clear, concise ...
false
Other
chartjs
Chart.js
2e0211320bbff4bc81e40062a4c4815cca256e2d.json
Fix a divide by 0 error when there is only 1 label
src/Chart.Core.js
@@ -1575,7 +1575,7 @@ var isRotated = (this.xLabelRotation > 0), // innerWidth = (this.offsetGridLines) ? this.width - offsetLeft - this.padding : this.width - (offsetLeft + halfLabelWidth * 2) - this.padding, innerWidth = this.width - (this.xScalePaddingLeft + this.xScalePaddingRight), - valueWidth = ...
false
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/charts/Chart.Doughnut.js
@@ -15,6 +15,6 @@ config.type = 'doughnut'; return new Chart(context, config); - } + }; }).call(this);
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/charts/Chart.Line.js
@@ -9,6 +9,6 @@ config.type = 'line'; return new Chart(context, config); - } + }; }).call(this);
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/charts/Chart.PolarArea.js
@@ -15,6 +15,6 @@ config.type = 'polarArea'; return new Chart(context, config); - } + }; }).call(this);
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/charts/Chart.Radar.js
@@ -14,6 +14,6 @@ config.type = 'radar'; return new Chart(context, config); - } + }; }).call(this);
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/charts/Chart.Scatter.js
@@ -34,6 +34,6 @@ config.options = helpers.configMerge(defaultConfig, config.options); config.type = 'line'; return new Chart(context, config); - } + }; }).call(this); \ No newline at end of file
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/controllers/controller.doughnut.js
@@ -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...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/controllers/controller.polarArea.js
@@ -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); ...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/controllers/controller.radar.js
@@ -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); ...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/core/core.controller.js
@@ -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 (helper...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/core/core.helpers.js
@@ -135,7 +135,7 @@ 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 overr...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/core/core.scale.js
@@ -112,7 +112,7 @@ // Reset position before calculating rotation this.top = 0; - this.bottom = this.height + this.bottom = this.height; } // Reset padding
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/elements/element.arc.js
@@ -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...
true
Other
chartjs
Chart.js
e46a2cb074e92342ec8d52a18177ac91bec04cde.json
Fix JSHint errors
src/scales/scale.category.js
@@ -21,23 +21,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 ...
true
Other
chartjs
Chart.js
35011e5ae396d5dd68961d14ec50d8ef5f3a809e.json
Support min and max dates on time scale
src/scales/scale.time.js
@@ -91,8 +91,17 @@ scaleLabelMoments.push(labelMoment); }, this); - this.firstTick = moment.min.call(this, scaleLabelMoments); - this.lastTick = moment.max.call(this, scaleLabelMoments); + if (this.options.time.min) { + this.firstTick = this.parseTime(this.options.time.min); + } else { + ...
false
Other
chartjs
Chart.js
86a52d030233944cdedc14bc1c5076c74826ea87.json
Fix some test failures
src/core/core.scale.js
@@ -48,7 +48,7 @@ reverse: false, show: true, callback: function(value) { - return value; + return '' + value; }, }, };
true
Other
chartjs
Chart.js
86a52d030233944cdedc14bc1c5076c74826ea87.json
Fix some test failures
src/scales/scale.logarithmic.js
@@ -10,7 +10,15 @@ // label settings ticks: { - template: "<%var remain = value / (Math.pow(10, Math.floor(Chart.helpers.log10(value))));if (remain === 1 || remain === 2 || remain === 5) {%><%=value.toExponential()%><%} else {%><%= null %><%}%>", + callback: function(value) { + var remain = value / (Math...
true
Other
chartjs
Chart.js
ceaa4ff03f7bc53bbc19711a023ea9313fdfde7f.json
Add a helper function to reduce code size
src/core/core.tooltip.js
@@ -60,6 +60,19 @@ }, }; + // Helper to push or concat based on if the 2nd parameter is an array or not + function pushOrConcat(base, toPush) { + if (toPush) { + if (helpers.isArray(toPush)) { + base = base.concat(toPush); + } else { + base.push(toPush); + } + } + + return base; + } + Chart.Tool...
false
Other
chartjs
Chart.js
6001a1e4e7d4a572e70cd55c049449ac85cbe134.json
Fix JSHint task
gulpfile.js
@@ -117,7 +117,7 @@ function releaseTask() { function jshintTask() { - return gulp.src(srcDir + '*.js') + return gulp.src(srcDir + '**/*.js') .pipe(jshint()) .pipe(jshint.reporter('default')); }
false
Other
chartjs
Chart.js
93ee8f85f66e3dcfc9b213ae9733ae12a513953e.json
Put comment back in correct spot
src/core/core.js
@@ -57,11 +57,11 @@ // High pixel density displays - multiply the size of the canvas height/width by the device pixel ratio, then scale. Chart.helpers.retinaScale(this); - // Always bind this so that if the responsive state changes we still work if (config) { this.controller = new Chart.Controller(this)...
false
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/bar.html
@@ -45,6 +45,7 @@ <h3>Legend</h3> backgroundColor: "rgba(220,220,220,0.5)", data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()] }, { + hidden:...
true
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/combo-bar-line.html
@@ -2,7 +2,7 @@ <html> <head> - <title>Bar Chart</title> + <title>Combo Bar-Line Chart</title> <script src="../node_modules/jquery/dist/jquery.min.js"></script> <script src="../Chart.js"></script> </head> @@ -30,14 +30,14 @@ borderColor: 'white', borderWidth: 2 ...
true
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/doughnut.html
@@ -61,6 +61,7 @@ <h3>Legend</h3> "#4D5360", ], }, { + hidden: true, data: [ randomScalingFactor(), randomScalingFactor(),
true
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/line-x-axis-filter.html
@@ -54,8 +54,8 @@ xAxes: [{ display: true, ticks: { - callback: function(dataLabel, index) { - return dataLabel; + userCallback: function(dataLabel, index) { + ...
true
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/line.html
@@ -48,6 +48,10 @@ <h3>Legend</h3> data: [randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor()], fill: false, borderDash: [5, 5], + }, ...
true
Other
chartjs
Chart.js
0d2fa807da54e2c56d3a3778741c8ee139238725.json
Update samples with some hidden datasets
samples/radar.html
@@ -42,14 +42,18 @@ <h3>Legend</h3> backgroundColor: "rgba(220,220,220,0.2)", pointBackgroundColor: "rgba(220,220,220,1)", data: [null, randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFactor(), randomScalingFacto...
true
Other
chartjs
Chart.js
5543041fcdf89d11be448fd341df37ae9fee1ccb.json
Add Moment.js back into test reps
gulpfile.js
@@ -37,6 +37,7 @@ var srcFiles = [ ]; var testFiles = [ + './node_modules/moment/min/moment.min.js', './test/mockContext.js', './test/*.js' ];
true
Other
chartjs
Chart.js
5543041fcdf89d11be448fd341df37ae9fee1ccb.json
Add Moment.js back into test reps
package.json
@@ -35,5 +35,8 @@ }, "spm": { "main": "Chart.js" + }, + "dependencies": { + "moment": "^2.10.6" } }
true
Other
chartjs
Chart.js
63a0273591b2943f9ff96262b26f1d5c9f5ca058.json
Remove moment and onecolor as deps
package.json
@@ -31,8 +31,6 @@ "karma-firefox-launcher": "^0.1.6", "karma-jasmine": "^0.3.6", "karma-jasmine-html-reporter": "^0.1.8", - "moment": "^2.10.6", - "onecolor": "^2.5.0", "semver": "^3.0.1" }, "spm": {
false
Other
chartjs
Chart.js
db3b5c1735216fecc6721fc271c6d2dd922adbd7.json
Fix broken helper test
test/core.helpers.tests.js
@@ -210,18 +210,19 @@ describe('Core helper tests', function() { type: 'linear', axisProp: 456 }, { - type: 'linear', display: true, - position: "right", + gridLines: { - show: true, color: "rgba(0, 0, 0, 0.1)", - lineWidth: 1, drawOnChartArea: true, - d...
false
Other
chartjs
Chart.js
dd62944b79e0294880dd510961bd2a85df540f9f.json
Fix bracket placement
src/scales/scale.linear.js
@@ -157,7 +157,7 @@ }, // Get the correct value. If the value type is object get the x or y based on whether we are horizontal or not getRightValue: function(rawValue) { - return typeof (rawValue === "object" && rawValue !== null) ? (this.isHorizontal() ? rawValue.x : rawValue.y) : rawValue; + return (type...
false
Other
chartjs
Chart.js
0c6f37fff744e8f00c57c51407136cc39d506409.json
Add support for mirror option
docs/00-Getting-Started.md
@@ -364,6 +364,12 @@ the following options. labels: { // Boolean - if true show labels show: true, + + // Boolean - if true the chart will mirror the axis labels. If the labels are on the left, mirroring the axis will render them to the right + mirror: false, + + ...
true
Other
chartjs
Chart.js
0c6f37fff744e8f00c57c51407136cc39d506409.json
Add support for mirror option
src/scales/scale.linear.js
@@ -28,11 +28,13 @@ // label settings labels: { show: true, + mirror: false, + padding: 10, template: "<%=value.toLocaleString()%>", fontSize: 12, fontStyle: "normal", fontColor: "#666", - fontFamily: "Helvetica Neue", + fontFamily: "Helvetica Neue" } }; @@ -548,12 +550,22 @@ ...
true
Other
chartjs
Chart.js
d7ee18372a0dbd857691725de8523baa8fc128e5.json
Fix error in generateLegend() function
src/Chart.Core.js
@@ -967,7 +967,7 @@ return this; }, generateLegend : function(){ - return template(this.options.legendTemplate,this); + return helpers.template(this.options.legendTemplate, {datasets: this.data.datasets}); }, destroy : function(){ this.clear();
false
Other
chartjs
Chart.js
79b02bcf26e2338e7acd01ffeb3a9f87c20a8088.json
add license to package.json just to be a good npm citizen :)
package.json
@@ -8,6 +8,7 @@ "type": "git", "url": "https://github.com/nnnick/Chart.js.git" }, + "license" : "MIT", "dependences": {}, "devDependencies": { "gulp": "3.5.x", @@ -25,4 +26,4 @@ "spm": { "main": "Chart.js" } -} \ No newline at end of file +}
false
Other
chartjs
Chart.js
f7e39620870787c4a49ee4c0085a46171d5f57b6.json
Call onAnimationComplete when reached last frame
src/Chart.Core.js
@@ -2141,8 +2141,11 @@ this.animations[i].animationObject.render(this.animations[i].chartInstance, this.animations[i].animationObject); + // Check if executed the last frame. if (this.animations[i].animationObject.currentStep == this.animations[i].animationObject.numSteps){ - // executed th...
false
Other
chartjs
Chart.js
6110352df8c732dcda28777bdd87abd25ddf74f8.json
Add userCallback to category scale + demo file
samples/line-x-axis-filter.html
@@ -0,0 +1,138 @@ +<!doctype html> +<html> + +<head> + <title>Chart with xAxis Filtering</title> + <script src="../Chart.js"></script> + <script src="../node_modules/jquery/dist/jquery.min.js"></script> + <style> + canvas { + -webkit-box-shadow: 0 0 20px 0 rgba(0, 0, 0, .5); + } + </style> +...
true
Other
chartjs
Chart.js
6110352df8c732dcda28777bdd87abd25ddf74f8.json
Add userCallback to category scale + demo file
src/scales/scale.category.js
@@ -37,13 +37,24 @@ isHorizontal: function() { return this.options.position == "top" || this.options.position == "bottom"; }, + buildLabels: function(index) { + this.labels = []; + + if (this.options.labels.userCallback) { + this.data.labels.forEach(function(labelString, index) { + this.labels.pus...
true
Other
chartjs
Chart.js
02616b9f17b336762ad061dc96b0688affd79b79.json
Fix the spelling of "separate"
docs/06-Advanced.md
@@ -176,7 +176,7 @@ npm install -g gulp This will install the local development dependencies for Chart.js, along with a CLI for the JavaScript task runner <a href="http://gulpjs.com/" target="_blank">gulp</a>. -Now, we can run the `gulp build` task, and pass in a comma seperated list of types as an argument to bui...
true
Other
chartjs
Chart.js
02616b9f17b336762ad061dc96b0688affd79b79.json
Fix the spelling of "separate"
src/Chart.Core.js
@@ -407,7 +407,7 @@ var maxValue = max(valuesArray), minValue = min(valuesArray); - // We need some degree of seperation here to calculate the scales if all the values are the same + // We need some degree of separation here to calculate the scales if all the values are the same // Adding/minusing 0....
true
Other
chartjs
Chart.js
02616b9f17b336762ad061dc96b0688affd79b79.json
Fix the spelling of "separate"
src/Chart.Line.js
@@ -294,7 +294,7 @@ },this); - // Control points need to be calculated in a seperate loop, because we need to know the current x/y of the point + // Control points need to be calculated in a separate loop, because we need to know the current x/y of the point // This would cause issues when there is ...
true
Other
chartjs
Chart.js
3985d50201cafe53cbb9abad5910fae2553e83e5.json
use correct option in radar chart
docs/05-Radar-Chart.md
@@ -46,7 +46,7 @@ pointBackgroundColor | `Color or Array<Color>` | The fill color for points pointBorderWidth | `Number or Array<Number>` | The width of the point border in pixels pointRadius | `Number or Array<Number>` | The radius of the point shape. If set to 0, nothing is rendered. pointHoverRadius | `Number or...
false
Other
chartjs
Chart.js
9ac0293b1ab57d058bd736bc175bed1544dd9331.json
Fix path in 09-Advanced.md
docs/09-Advanced.md
@@ -182,7 +182,7 @@ var myPieChart = new Chart(ctx, { }); ``` -See `sample/line-customTooltips.html` for examples on how to get started. +See `samples/tooltips/line-customTooltips.html` for examples on how to get started. ### Writing New Scale Types
false
Other
chartjs
Chart.js
3f2d7efc70409f9a8fd70ea093bf008f592132af.json
Add a function to filter items out of the legend
docs/01-Chart-Configuration.md
@@ -154,6 +154,7 @@ fontColor | Color | "#666" | Font color inherited from global configuration fontFamily | String | "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif" | Font family inherited from global configuration padding | Number | 10 | Padding between rows of colored boxes generateLabels: | Function | `func...
true
Other
chartjs
Chart.js
3f2d7efc70409f9a8fd70ea093bf008f592132af.json
Add a function to filter items out of the legend
src/core/core.legend.js
@@ -162,10 +162,20 @@ module.exports = function(Chart) { beforeBuildLabels: noop, buildLabels: function() { var me = this; - me.legendItems = me.options.labels.generateLabels.call(me, me.chart); + var labelOpts = me.options.labels; + var legendItems = labelOpts.generateLabels.call(me, me.chart); + + i...
true
Other
chartjs
Chart.js
3f2d7efc70409f9a8fd70ea093bf008f592132af.json
Add a function to filter items out of the legend
test/core.legend.tests.js
@@ -90,6 +90,71 @@ describe('Legend block tests', function() { }]); }); + it('should filter items', function() { + var chart = window.acquireChart({ + type: 'bar', + data: { + datasets: [{ + label: 'dataset1', + backgroundColor: '#f31', + borderCapStyle: 'butt', + borderDash: [2, 2], + ...
true
Other
chartjs
Chart.js
6b449a9e7c56d873edc28b3e2dcf976b2ea27404.json
Fix retina scale when display size is implicit The retinaScale helper now enforces the display size to the correct values because if no style has been set on the canvas, the render size is used as display size, making the chart bigger (or smaller) when deviceAspectRatio is different of 1.
src/core/core.controller.js
@@ -287,12 +287,11 @@ module.exports = function(Chart) { canvas.width = chart.width = newWidth; canvas.height = chart.height = newHeight; - - helpers.retinaScale(chart); - canvas.style.width = newWidth + 'px'; canvas.style.height = newHeight + 'px'; + helpers.retinaScale(chart); + // Notify ...
true
Other
chartjs
Chart.js
6b449a9e7c56d873edc28b3e2dcf976b2ea27404.json
Fix retina scale when display size is implicit The retinaScale helper now enforces the display size to the correct values because if no style has been set on the canvas, the render size is used as display size, making the chart bigger (or smaller) when deviceAspectRatio is different of 1.
src/core/core.helpers.js
@@ -832,17 +832,24 @@ module.exports = function(Chart) { document.defaultView.getComputedStyle(el, null).getPropertyValue(property); }; helpers.retinaScale = function(chart) { - var ctx = chart.ctx; - var canvas = chart.canvas; - var width = canvas.width; - var height = canvas.height; var pixelRatio = ch...
true
Other
chartjs
Chart.js
6b449a9e7c56d873edc28b3e2dcf976b2ea27404.json
Fix retina scale when display size is implicit The retinaScale helper now enforces the display size to the correct values because if no style has been set on the canvas, the render size is used as display size, making the chart bigger (or smaller) when deviceAspectRatio is different of 1.
test/core.controller.tests.js
@@ -93,7 +93,7 @@ describe('Chart.Controller', function() { expect(data.datasets.length).toBe(0); }); - it('should NOT alter config.data references', function() { + it('should not alter config.data references', function() { var ds0 = {data: [10, 11, 12, 13]}; var ds1 = {data: [20, 21, 22, 23]}; v...
true
Other
chartjs
Chart.js
6b449a9e7c56d873edc28b3e2dcf976b2ea27404.json
Fix retina scale when display size is implicit The retinaScale helper now enforces the display size to the correct values because if no style has been set on the canvas, the render size is used as display size, making the chart bigger (or smaller) when deviceAspectRatio is different of 1.
test/mockContext.js
@@ -214,16 +214,19 @@ var chart = actual.chart; var canvas = chart.ctx.canvas; var style = getComputedStyle(canvas); + var pixelRatio = window.devicePixelRatio; var dh = parseInt(style.height, 10); var dw = parseInt(style.width, 10); var rh = canvas.height; var rw = canvas.width; +...
true
Other
chartjs
Chart.js
a94885e32d611723f35393726dac93872e1b1a74.json
Fix the event handler when legend is disabled (#3544) When legend is disabled (i.e. {options: {legend: false}}), me.legend is null. Add the same test on me.tooltip even if the tooltip object is always created in case of {options: {tooltips: false}}.
src/core/core.controller.js
@@ -719,15 +719,17 @@ module.exports = function(Chart) { eventHandler: function(e) { var me = this; + var legend = me.legend; + var tooltip = me.tooltip; var hoverOptions = me.options.hover; // Buffer any update calls so that renders do not occur me._bufferedRender = true; me._bufferedReq...
false
Other
chartjs
Chart.js
5012dcbdaefa7a11a8dfcd9ff264655e9860ee50.json
Fix iframe resize handler when re-attached to DOM (#3527) When the iframe is attached to the DOM, its content is reloaded (invaliding the resize listener) so make sure to install the handler after the iframe is loaded. Optimize resize events by throttling resize process until the next animation frame. Rewrite the unit...
src/core/core.helpers.js
@@ -943,9 +943,7 @@ module.exports = function(Chart) { return color(c); }; helpers.addResizeListener = function(node, callback) { - // Hide an iframe before the node var iframe = document.createElement('iframe'); - iframe.className = 'chartjs-hidden-iframe'; iframe.style.cssText = 'display:block;'+...
true
Other
chartjs
Chart.js
5012dcbdaefa7a11a8dfcd9ff264655e9860ee50.json
Fix iframe resize handler when re-attached to DOM (#3527) When the iframe is attached to the DOM, its content is reloaded (invaliding the resize listener) so make sure to install the handler after the iframe is loaded. Optimize resize events by throttling resize process until the next animation frame. Rewrite the unit...
test/core.controller.tests.js
@@ -1,7 +1,16 @@ describe('Chart.Controller', function() { - function processResizeEvent(chart, callback) { - setTimeout(callback, 100); + function waitForResize(chart, callback) { + var resizer = chart.chart.canvas.parentNode._chartjs.resizer; + var content = resizer.contentWindow || resizer; + var state = cont...
true
Other
chartjs
Chart.js
99041de31a80af789441a84181953a7282d6c64d.json
Update installation instructions in README
README.md
@@ -8,15 +8,24 @@ ## Installation -You can download the latest version of [Chart.js on GitHub](https://github.com/chartjs/Chart.js/releases/latest) or just use these [Chart.js CDN](https://cdnjs.com/libraries/Chart.js) links. +You can download the latest version of Chart.js from the [GitHub releases](https://githu...
false
Other
chartjs
Chart.js
274aa290ca69f38aac5fd1a5fb55cc5043ea5d8c.json
Fix bug in 'y' tooltip mode
src/core/core.interaction.js
@@ -260,7 +260,7 @@ module.exports = function(Chart) { var position = helpers.getRelativePosition(e, chart.chart); var items = []; parseVisibleItems(chart, function(element) { - if (element.inYRange(position.x)) { + if (element.inYRange(position.y)) { items.push(element); } });
false
Other
chartjs
Chart.js
5ae268e94236b921d6cc966c580cd4984d5f4f94.json
Add a way to filter items in the tooltip
docs/01-Chart-Configuration.md
@@ -225,6 +225,7 @@ mode | String | 'nearest' | Sets which elements appear in the tooltip. See [Inte intersect | Boolean | true | if true, the tooltip mode applies only when the mouse position intersects with an element. If false, the mode will be applied at all times. position | String | 'average' | The mode for pos...
true
Other
chartjs
Chart.js
5ae268e94236b921d6cc966c580cd4984d5f4f94.json
Add a way to filter items in the tooltip
src/core/core.tooltip.js
@@ -485,6 +485,13 @@ module.exports = function(Chart) { tooltipItems.push(createTooltipItem(active[i])); } + // If the user provided a filter function, use it to modify the tooltip items + if (opts.filter) { + tooltipItems = tooltipItems.filter(function(a) { + return opts.filter(a, data); + ...
true
Other
chartjs
Chart.js
5ae268e94236b921d6cc966c580cd4984d5f4f94.json
Add a way to filter items in the tooltip
test/core.tooltip.tests.js
@@ -543,6 +543,78 @@ describe('Core.Tooltip', function() { expect(tooltip._view.y).toBeCloseToPixel(155); }); + it('should filter items from the tooltip using the callback', function() { + var chartInstance = window.acquireChart({ + type: 'line', + data: { + datasets: [{ + label: 'Dataset 1', + d...
true
Other
chartjs
Chart.js
3bd4d283f758ccac1e3dd378d9157faef4a133bd.json
Custom tooltip: add data points infos (#3201) Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
docs/01-Chart-Configuration.md
@@ -271,6 +271,7 @@ afterBody | `Array[tooltipItem], data` | Text to render after the body section beforeFooter | `Array[tooltipItem], data` | Text to render before the footer section footer | `Array[tooltipItem], data` | Text to render as the footer afterFooter | `Array[tooltipItem], data` | Text to render after th...
true
Other
chartjs
Chart.js
3bd4d283f758ccac1e3dd378d9157faef4a133bd.json
Custom tooltip: add data points infos (#3201) Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
docs/09-Advanced.md
@@ -226,12 +226,12 @@ Scale instances are given the following properties during the fitting process. { left: Number, // left edge of the scale bounding box right: Number, // right edge of the bounding box' - top: Number, + top: Number, bottom: Number, width: Number, // the same as right - left height: Numbe...
true
Other
chartjs
Chart.js
3bd4d283f758ccac1e3dd378d9157faef4a133bd.json
Custom tooltip: add data points infos (#3201) Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
samples/dataPoints-customTooltips.html
@@ -0,0 +1,104 @@ +<!doctype html> +<html> + +<head> + <title>Custom Tooltips using Data Points</title> + <script src="../dist/Chart.bundle.js"></script> + <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> + <style> + canvas{ + -moz-user-select: none; + -webkit-us...
true
Other
chartjs
Chart.js
3bd4d283f758ccac1e3dd378d9157faef4a133bd.json
Custom tooltip: add data points infos (#3201) Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
src/core/core.tooltip.js
@@ -118,7 +118,9 @@ module.exports = function(Chart) { xLabel: xScale ? xScale.getLabelForIndex(index, datasetIndex) : '', yLabel: yScale ? yScale.getLabelForIndex(index, datasetIndex) : '', index: index, - datasetIndex: datasetIndex + datasetIndex: datasetIndex, + x: element._model.x, + y: element....
true
Other
chartjs
Chart.js
3bd4d283f758ccac1e3dd378d9157faef4a133bd.json
Custom tooltip: add data points infos (#3201) Expose tooltip items from tooltip model and added `x` and `y` properties to `TooltipItemInterface`
test/core.tooltip.tests.js
@@ -542,4 +542,64 @@ describe('Core.Tooltip', function() { expect(tooltip._view.x).toBeCloseToPixel(269); expect(tooltip._view.y).toBeCloseToPixel(155); }); + + it('Should have dataPoints', function() { + var chartInstance = window.acquireChart({ + type: 'line', + data: { + datasets: [{ + label: 'Da...
true
Other
chartjs
Chart.js
a0ce74643f3d6f7ad6f2f4a8ac4343d6526b91a8.json
Fix eslint errors in layout service test
gulpfile.js
@@ -152,7 +152,8 @@ function lintTask() { 'it', 'jasmine', 'moment', - 'spyOn' + 'spyOn', + 'xit' ] };
true
Other
chartjs
Chart.js
a0ce74643f3d6f7ad6f2f4a8ac4343d6526b91a8.json
Fix eslint errors in layout service test
test/core.layoutService.tests.js
@@ -1,8 +1,8 @@ // Tests of the scale service describe('Test the layout service', function() { // Disable tests which need to be rewritten based on changes introduced by - // the following changes: https://github.com/chartjs/Chart.js/pull/2346 - // using xit marks the test as pending: http://jasmine.github.io/2...
true
Other
chartjs
Chart.js
16f23b2c44ebeccda1e144b3dd75e9c63f81307b.json
Add reset method to chart prototype
docs/09-Advanced.md
@@ -34,6 +34,14 @@ myLineChart.data.datasets[0].data[2] = 50; // Would update the first dataset's v myLineChart.update(); // Calling update now animates the position of March from 90 to 50. ``` +#### .reset() + +Reset the chart to it's state before the initial animation. A new animation can then be triggered using ...
true
Other
chartjs
Chart.js
16f23b2c44ebeccda1e144b3dd75e9c63f81307b.json
Add reset method to chart prototype
src/core/core.controller.js
@@ -409,13 +409,27 @@ module.exports = function(Chart) { return newControllers; }, + /** + * Reset the elements of all datasets + * @method resetElements + * @private + */ resetElements: function() { var me = this; helpers.each(me.data.datasets, function(dataset, datasetIndex) { me.get...
true
Other
chartjs
Chart.js
16f23b2c44ebeccda1e144b3dd75e9c63f81307b.json
Add reset method to chart prototype
test/core.controller.tests.js
@@ -666,4 +666,38 @@ describe('Chart.Controller', function() { expect(wrapper.firstChild.tagName).toBe('CANVAS'); }); }); + + describe('controller.reset', function() { + it('should reset the chart elements', function() { + var chart = acquireChart({ + type: 'line', + data: { + labels: ['A', 'B', '...
true
Other
chartjs
Chart.js
766ca49cd094562f3a2e870e0c2b162ee16c8189.json
Extend eslint to test files (#3473) * Add eslint to test files * Fix mockContext for tests * Make formatting look better for nested objects
gulpfile.js
@@ -22,6 +22,7 @@ var package = require('./package.json'); var srcDir = './src/'; var outDir = './dist/'; +var testDir = './test/'; var header = "/*!\n" + " * Chart.js\n" + @@ -132,6 +133,7 @@ function packageTask() { function lintTask() { var files = [ srcDir + '**/*.js', + testDir + '**/*.js' ...
true