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
a10e245e5ad743686f691d549b2ec3257c7650cb.json
Use correct tooltip events in each chart
src/Chart.Doughnut.js
@@ -53,7 +53,7 @@ //Set up tooltip events on the chart if (this.options.showTooltips) { - helpers.bindEvents(this, this.options.tooltipEvents, this.onHover); + helpers.bindEvents(this, this.options.events, this.onHover); } // Create n...
true
Other
chartjs
Chart.js
a10e245e5ad743686f691d549b2ec3257c7650cb.json
Use correct tooltip events in each chart
src/Chart.PolarArea.js
@@ -103,7 +103,7 @@ //Set up tooltip events on the chart if (this.options.showTooltips){ - helpers.bindEvents(this, this.options.tooltipEvents, function(evt){ + helpers.bindEvents(this, this.options.events, function(evt){ var activeSegments = (evt.type !== 'mouseout') ? this.getSegmentsAtEvent(evt...
true
Other
chartjs
Chart.js
a10e245e5ad743686f691d549b2ec3257c7650cb.json
Use correct tooltip events in each chart
src/Chart.Radar.js
@@ -81,7 +81,7 @@ //Set up tooltip events on the chart if (this.options.showTooltips){ - helpers.bindEvents(this, this.options.tooltipEvents, function(evt){ + helpers.bindEvents(this, this.options.events, function(evt){ var activePointsCollection = (evt.type !== 'mouseout') ? this.getPointsAtEvent...
true
Other
chartjs
Chart.js
a10e245e5ad743686f691d549b2ec3257c7650cb.json
Use correct tooltip events in each chart
src/Chart.Scatter.js
@@ -114,7 +114,7 @@ }); // Events - helpers.bindEvents(this, this.options.tooltipEvents, this.events); + helpers.bindEvents(this, this.options.events, this.events); // Build Scale this.buildScale();
true
Other
chartjs
Chart.js
a559ab85cd16a1e18e14f4aacbbc0fd6f7f75cbd.json
Ensure consistency in the helpers.toRadians name
src/Chart.Core.js
@@ -402,7 +402,7 @@ return 0; } }, - toRadians = helpers.radians = function(degrees) { + toRadians = helpers.toRadians = function(degrees) { return degrees * (Math.PI / 180); }, toDegrees = helpers.toDegrees = function(radians) {
false
Other
chartjs
Chart.js
008bb1aab365c46cbf479cbf9ae2bd98f2350bef.json
Set new tooltip templates for the scatter chart
samples/scatter.html
@@ -88,7 +88,7 @@ var ctx = document.getElementById("canvas").getContext("2d"); window.myScatter = new Chart(ctx).Scatter(scatterChartData, { responsive: true, - hoverMode: 'single', + hoverMode: 'single', // should always use single for a scatter chart ...
true
Other
chartjs
Chart.js
008bb1aab365c46cbf479cbf9ae2bd98f2350bef.json
Set new tooltip templates for the scatter chart
src/Chart.Scatter.js
@@ -6,7 +6,7 @@ helpers = Chart.helpers; var defaultConfig = { - + hoverMode: 'single', scales: { xAxes: [{ scaleType: "linear", // scatter should not use a dataset axis @@ -94,6 +94,9 @@ //String - A legend template legendTemplate: "<ul cl...
true
Other
chartjs
Chart.js
4b8c9bc30d9137bc375c3527c8742036ed524377.json
Fix a drawing bug when drawTicks is false.
samples/scatter-multi-axis.html
@@ -95,6 +95,7 @@ hoverMode: 'single', scales: { xAxes: [{ + position: "bottom", gridLines: { zeroLineColor: "rgba(0,0,0,1)" }
true
Other
chartjs
Chart.js
4b8c9bc30d9137bc375c3527c8742036ed524377.json
Fix a drawing bug when drawTicks is false.
src/Chart.Scale.js
@@ -538,8 +538,9 @@ xValue += helpers.aliasPixel(this.ctx.lineWidth); // Draw the label area - if (this.options.gridLines.drawTicks) { - this.ctx.beginPath(); + this.ctx.beginPath(); + + if (this.options.gridLines.drawTicks) { this.ctx.moveTo(xValue, yTickStar...
true
Other
chartjs
Chart.js
43438d630308fb81662d6549ec74ddf49c33cd99.json
Update doc version #
docs/07-Advanced.md
@@ -368,7 +368,7 @@ The bar controller has a special property that you should be aware of. To correc ### Creating Plugins -Starting with v2.0.3, you can create plugins for chart.js. To register your plugin, simply call `Chart.pluginService.register` and pass your plugin in. +Starting with v2.1.0, you can create pl...
false
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/01-Line-Chart.md
@@ -1,169 +0,0 @@ ---- -title: Line Chart -anchor: line-chart ---- -###Introduction -A line chart is a way of plotting data points on a line. - -Often, it is used to show trend data, and the comparison of two data sets. - -<div class="canvas-holder"> - <canvas width="250" height="125"></canvas> -</div> - -###Example us...
true
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/02-Bar-Chart.md
@@ -1,149 +0,0 @@ ---- -title: Bar Chart -anchor: bar-chart ---- - -### Introduction -A bar chart is a way of showing data as bars. - -It is sometimes used to show trend data, and the comparison of multiple data sets side by side. - -<div class="canvas-holder"> - <canvas width="250" height="125"></canvas> -</div> - -##...
true
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/03-Radar-Chart.md
@@ -1,180 +0,0 @@ ---- -title: Radar Chart -anchor: radar-chart ---- - -###Introduction -A radar chart is a way of showing multiple data points and the variation between them. - -They are often useful for comparing the points of two or more different data sets. - -<div class="canvas-holder"> - <canvas width="250" heigh...
true
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/04-Polar-Area-Chart.md
@@ -1,172 +0,0 @@ ---- -title: Polar Area Chart -anchor: polar-area-chart ---- -### Introduction -Polar area charts are similar to pie charts, but each segment has the same angle - the radius of the segment differs depending on the value. - -This type of chart is often useful when we want to show a comparison data simi...
true
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/05-Pie-Doughnut-Chart.md
@@ -1,160 +0,0 @@ ---- -title: Pie & Doughnut Charts -anchor: doughnut-pie-chart ---- -###Introduction -Pie and doughnut charts are probably the most commonly used chart there are. They are divided into segments, the arc of each segment shows the proportional value of each piece of data. - -They are excellent at showin...
true
Other
chartjs
Chart.js
d5af01b2c76e144c6c7a7830903a67709cb17763.json
Remove old doc files
docs/06-Advanced.md
@@ -1,187 +0,0 @@ ---- -title: Advanced usage -anchor: advanced-usage ---- - - -### Prototype methods - -For each chart, there are a set of global prototype methods on the shared `ChartType` which you may find useful. These are available on all charts created with Chart.js, but for the examples, let's use a line chart ...
true
Other
chartjs
Chart.js
fbb6da139333b0172cd27f7b9cad23869eb3081d.json
Remove unnecessary line from code climate config
.codeclimate.yml
@@ -1,4 +1,3 @@ ---- engines: duplication: enabled: true
false
Other
chartjs
Chart.js
5fa60033611690ef48db1e6b934e7a8c095349af.json
fix "main" file path in bower.json
bower.json
@@ -5,9 +5,9 @@ "homepage": "https://github.com/nnnick/Chart.js", "author": "nnnick", "main": [ - "Chart.js" + "dist/Chart.js" ], "devDependencies": { "jquery": "~2.1.4" } -} \ No newline at end of file +}
false
Other
chartjs
Chart.js
8c2bc34b9c36eb1c79b4aa0313cb01012059444d.json
Fix whitespace in Line Chart documentation
docs/02-Line-Chart.md
@@ -48,16 +48,16 @@ var data = { borderColor: "rgba(220,220,220,1)", // String - cap style of the line. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap - borderCapStyle: 'butt', + borderCapStyle: 'butt', - // Array - Length and spacing of dashes....
false
Other
chartjs
Chart.js
c6318749da660f6d8599b466b3871f437123c1d0.json
Drop official support for Bower Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
README.md
@@ -10,13 +10,14 @@ 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. -To install via npm / bower: +To install via npm: ```bash npm install chart.js --save -bower install...
true
Other
chartjs
Chart.js
c6318749da660f6d8599b466b3871f437123c1d0.json
Drop official support for Bower Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
bower.json
@@ -1,14 +0,0 @@ -{ - "name": "Chart.js", - "version": "2.1.6", - "description": "Simple HTML5 Charts using the canvas element", - "homepage": "https://github.com/chartjs/Chart.js", - "author": "nnnick", - "license": "MIT", - "main": [ - "dist/Chart.js" - ], - "devDependencies": { - "jquery": "~2.1.4" - ...
true
Other
chartjs
Chart.js
c6318749da660f6d8599b466b3871f437123c1d0.json
Drop official support for Bower Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
docs/00-Getting-Started.md
@@ -9,13 +9,30 @@ You can download the latest version of [Chart.js on GitHub](https://github.com/c ### Installation -To install via npm / bower: +#### npm ```bash npm install chart.js --save ``` + +#### bower + +Bower support has been dropped since version 2.2.0 but you can still use Chart.js with Bower thank...
true
Other
chartjs
Chart.js
c6318749da660f6d8599b466b3871f437123c1d0.json
Drop official support for Bower Remove the bower.json file and update the documentation with the alternative bower-npm-resolver solution.
gulpfile.js
@@ -14,7 +14,6 @@ var gulp = require('gulp'), exec = require('child_process').exec, fs = require('fs'), package = require('./package.json'), - bower = require('./bower.json'), karma = require('gulp-karma'), browserify = require('browserify'), streamify = require('gulp-streamify'), @@ -121,7 +120,7 @@...
true
Other
chartjs
Chart.js
782b84ae944f74dd3ccddf35273ae6538a21c45a.json
Make Travis to release the npm package Add .npmignore to include dist/*.js files to the npm release (but exclude zip files). See https://docs.travis-ci.com/user/deployment/npm/. Also cleanup the .gitignore file.
.gitignore
@@ -1,14 +1,8 @@ +/coverage +/custom +/dist +/docs/index.md +/node_modules .DS_Store - -node_modules/* -custom/* -dist/* - -docs/index.md - -bower_components/ - -coverage/* .idea -nbproject/*
true
Other
chartjs
Chart.js
782b84ae944f74dd3ccddf35273ae6538a21c45a.json
Make Travis to release the npm package Add .npmignore to include dist/*.js files to the npm release (but exclude zip files). See https://docs.travis-ci.com/user/deployment/npm/. Also cleanup the .gitignore file.
.npmignore
@@ -0,0 +1,13 @@ +/.git +/.github +/coverage +/custom +/dist/*.zip +/docs/index.md +/node_modules + +.codeclimate.yml +.DS_Store +.gitignore +.idea +.travis.yml
true
Other
chartjs
Chart.js
782b84ae944f74dd3ccddf35273ae6538a21c45a.json
Make Travis to release the npm package Add .npmignore to include dist/*.js files to the npm release (but exclude zip files). See https://docs.travis-ci.com/user/deployment/npm/. Also cleanup the .gitignore file.
.travis.yml
@@ -32,7 +32,7 @@ addons: - google-chrome-stable deploy: - provider: releases +- provider: releases api_key: secure: E6JiZzA/Qy+UD1so/rVfqYnMhgU4m0cUsljxyrKIiYKlt/ZXo1XJabNkpEIYLvckrNx+g/4cmidNcuLfrnAZJtUg53qHLxyqMTXa9zAqmxxJ6aIpQpNK25FIEk9Xwm2XZdbI5rrm0ZciP5rcgg0X8/j5+RtnU3ZpTOCVkp0P73A= file: @@...
true
Other
chartjs
Chart.js
0579fbb7415836728aff0595cf15ec44ac244f6c.json
Add download links to the latest version Remove outdated *standard build* and *bundled with Moment.js* links from the documentation and add a link to the latest GitHub release, from where the user can download `*.js` files.
README.md
@@ -8,15 +8,14 @@ ## Installation -To download a zip, go to the Chart.js on Github +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. To install via npm / bower: ```bas...
true
Other
chartjs
Chart.js
0579fbb7415836728aff0595cf15ec44ac244f6c.json
Add download links to the latest version Remove outdated *standard build* and *bundled with Moment.js* links from the documentation and add a link to the latest GitHub release, from where the user can download `*.js` files.
docs/00-Getting-Started.md
@@ -5,10 +5,9 @@ anchor: getting-started ### Download Chart.js -To download a zip, go to [Chart.js on Github](https://github.com/chartjs/Chart.js) and choose the version that is right for your application. -* [Standard build](https://raw.githubusercontent.com/chartjs/Chart.js/master/dist/Chart.js) (~31kB gzipped) ...
true
Other
chartjs
Chart.js
72edacd877f59c2f471b2366d60d0fb051734aed.json
Make Travis to deploy built files for tags See https://docs.travis-ci.com/user/deployment/releases
.travis.yml
@@ -11,6 +11,7 @@ before_script: - npm install script: + - gulp build - gulp test - gulp coverage - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls @@ -28,3 +29,16 @@ addons: - google-chrome packages: - google-chrome-stable + +deploy: + provider: releases + api_key: + se...
false
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.bar.js
@@ -40,7 +40,7 @@ module.exports = function(Chart) { }, // Get the number of datasets that display bars. We use this to correctly calculate the bar width - getBarCount: function getBarCount() { + getBarCount: function() { var me = this; var barCount = 0; helpers.each(me.chart.data.datasets, functi...
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.bubble.js
@@ -41,7 +41,7 @@ module.exports = function(Chart) { dataElementType: Chart.elements.Point, - update: function update(reset) { + update: function(reset) { var me = this; var meta = me.getMeta(); var points = meta.data;
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.doughnut.js
@@ -119,7 +119,7 @@ module.exports = function(Chart) { linkScales: helpers.noop, // Get index of the dataset in relation to the visible datasets. This allows determining the inner and outer radius correctly - getRingIndex: function getRingIndex(datasetIndex) { + getRingIndex: function(datasetIndex) { var ...
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.line.js
@@ -46,7 +46,7 @@ module.exports = function(Chart) { } }, - update: function update(reset) { + update: function(reset) { var me = this; var meta = me.getMeta(); var line = meta.dataset;
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.polarArea.js
@@ -105,7 +105,7 @@ module.exports = function(Chart) { linkScales: helpers.noop, - update: function update(reset) { + update: function(reset) { var me = this; var chart = me.chart; var chartArea = chart.chartArea;
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/controllers/controller.radar.js
@@ -30,7 +30,7 @@ module.exports = function(Chart) { this.updateBezierControlPoints(); }, - update: function update(reset) { + update: function(reset) { var me = this; var meta = me.getMeta(); var line = meta.dataset;
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/core/core.controller.js
@@ -45,7 +45,7 @@ module.exports = function(Chart) { helpers.extend(Chart.Controller.prototype, /** @lends Chart.Controller */ { - initialize: function initialize() { + initialize: function() { var me = this; // Before init plugin notification Chart.plugins.notify('beforeInit', [me]); @@ -68,12 +68,...
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/core/core.datasetController.js
@@ -105,7 +105,7 @@ module.exports = function(Chart) { me.updateElement(element, index, true); }, - buildOrUpdateElements: function buildOrUpdateElements() { + buildOrUpdateElements: function() { // Handle the number of data points changing var meta = this.getMeta(), md = meta.data,
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/core/core.scale.js
@@ -390,7 +390,7 @@ module.exports = function(Chart) { }, // Get the correct value. NaN bad inputs, If the value type is object get the x or y based on whether we are horizontal or not - getRightValue: function getRightValue(rawValue) { + getRightValue: function(rawValue) { // Null and undefined values fi...
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/core/core.tooltip.js
@@ -328,7 +328,7 @@ module.exports = function(Chart) { return me; }, - getTooltipSize: function getTooltipSize(vm) { + getTooltipSize: function(vm) { var ctx = this._chart.ctx; var size = { @@ -391,7 +391,7 @@ module.exports = function(Chart) { return size; }, - determineAlignment: functi...
true
Other
chartjs
Chart.js
47912f49b410334e547f710ff473ac36682a2c76.json
Remove duplicated function names
src/scales/scale.time.js
@@ -309,7 +309,7 @@ module.exports = function(Chart) { return label; }, // Function to format an individual tick mark - tickFormatFunction: function tickFormatFunction(tick, index, ticks) { + tickFormatFunction: function(tick, index, ticks) { var formattedTick = tick.format(this.displayFormat); var ...
true
Other
chartjs
Chart.js
f106e1bf2db1aa604edb62b8e3b309329c41dd94.json
fix tooltip with array returns
src/core/core.tooltip.js
@@ -86,7 +86,8 @@ module.exports = function(Chart) { function pushOrConcat(base, toPush) { if (toPush) { if (helpers.isArray(toPush)) { - base = base.concat(toPush); + //base = base.concat(toPush); + Array.prototype.push.apply(base, toPush); } else { base.push(toPush); }
false
Other
chartjs
Chart.js
a55c17d73fa7bfa9e2780fce3ea9a7770a11d8d3.json
Enhance plugin notification system Change the plugin notification behavior: this method now returns false as soon as a plugin *explicitly* returns false, else returns true. Also, plugins are now called in their own scope (so remove the never used `scope` parameter).
src/core/core.plugin.js
@@ -2,8 +2,7 @@ module.exports = function(Chart) { - var helpers = Chart.helpers; - var noop = helpers.noop; + var noop = Chart.helpers.noop; /** * The plugin service singleton @@ -30,21 +29,33 @@ module.exports = function(Chart) { }, /** - * Calls registered plugins on the specified method, with ...
true
Other
chartjs
Chart.js
a55c17d73fa7bfa9e2780fce3ea9a7770a11d8d3.json
Enhance plugin notification system Change the plugin notification behavior: this method now returns false as soon as a plugin *explicitly* returns false, else returns true. Also, plugins are now called in their own scope (so remove the never used `scope` parameter).
test/core.plugin.tests.js
@@ -37,17 +37,36 @@ describe('Test the plugin system', function() { Chart.plugins.remove(myplugin); }); - it ('Should allow notifying plugins', function() { - var myplugin = { - count: 0, - trigger: function(chart) { - myplugin.count = chart.count; - } - }; - Chart.plugins.register(myplugin); + descr...
true
Other
chartjs
Chart.js
fbecfa2baf81cd009896ebbca4a225d95dd83084.json
Reduce duplicated code in core scale draw method
src/core/core.scale.js
@@ -490,9 +490,8 @@ module.exports = function(Chart) { var isRotated = me.labelRotation !== 0; var skipRatio; - var scaleLabelX; - var scaleLabelY; var useAutoskipper = optionTicks.autoSkip; + var isHorizontal = me.isHorizontal(); // figure out the maximum number of gridlines to show var m...
false
Other
chartjs
Chart.js
f71f525caf852ad46ae6fc875e879cc10804b051.json
fix typo in tooltip conf doc.
docs/01-Chart-Configuration.md
@@ -189,7 +189,7 @@ var chartInstance = new Chart(ctx, { ### Tooltip Configuration -The title configuration is passed into the `options.tooltips` namespace. The global options for the chart tooltips is defined in `Chart.defaults.global.title`. +The title configuration is passed into the `options.tooltips` namespac...
false
Other
chartjs
Chart.js
5c56f5cd9d437c13d5f158e1ae7a0bdfbbb8ef72.json
Use bundle-collapser to reduce build size This browserify plugin converts required string paths to int (see https://github.com/substack/bundle-collapser), lowering our *.min.js by ~1.8KB.
gulpfile.js
@@ -18,7 +18,8 @@ var gulp = require('gulp'), browserify = require('browserify'), streamify = require('gulp-streamify'), source = require('vinyl-source-stream'), - merge = require('merge-stream'); + merge = require('merge-stream'), + collapse = require('bundle-collapser/plugin'); var srcDir = './src/'; ...
true
Other
chartjs
Chart.js
5c56f5cd9d437c13d5f158e1ae7a0bdfbbb8ef72.json
Use bundle-collapser to reduce build size This browserify plugin converts required string paths to int (see https://github.com/substack/bundle-collapser), lowering our *.min.js by ~1.8KB.
package.json
@@ -12,6 +12,7 @@ "devDependencies": { "browserify": "^13.0.0", "browserify-istanbul": "^0.2.1", + "bundle-collapser": "^1.2.1", "coveralls": "^2.11.6", "gulp": "3.9.x", "gulp-concat": "~2.1.x", @@ -50,4 +51,4 @@ "chartjs-color": "^2.0.0", "moment": "^2.10.6" } -} \ No newlin...
true
Other
chartjs
Chart.js
148c66fe957e1211d65f975b72945a66118a514e.json
Update this -> me with master
src/core/core.controller.js
@@ -83,7 +83,7 @@ module.exports = function(Chart) { var newWidth = helpers.getMaximumWidth(canvas); var aspectRatio = chart.aspectRatio; var newHeight = (me.options.maintainAspectRatio && isNaN(aspectRatio) === false && isFinite(aspectRatio) && aspectRatio !== 0) ? newWidth / aspectRatio : helpers.getMaxim...
false
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
docs/01-Chart-Configuration.md
@@ -72,6 +72,7 @@ maintainAspectRatio | Boolean | true | Maintain the original canvas aspect ratio events | Array[String] | `["mousemove", "mouseout", "click", "touchstart", "touchmove", "touchend"]` | Events that the chart should listen to for tooltips and hovering onClick | Function | null | Called if the event is ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
docs/09-Advanced.md
@@ -381,6 +381,9 @@ Plugins will be called at the following times * End of update (before render occurs) * Start of draw * End of draw +* Before datasets draw +* After datasets draw +* Resize * Before an animation is started Plugins should derive from Chart.PluginBase and implement the following interface @@ -38...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/controllers/controller.bar.js
@@ -41,50 +41,53 @@ module.exports = function(Chart) { // Get the number of datasets that display bars. We use this to correctly calculate the bar width getBarCount: function getBarCount() { + var me = this; var barCount = 0; - helpers.each(this.chart.data.datasets, function(dataset, datasetIndex) { - ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/controllers/controller.doughnut.js
@@ -132,8 +132,8 @@ module.exports = function(Chart) { }, update: function update(reset) { - var _this = this; - var chart = _this.chart, + var me = this; + var chart = me.chart, chartArea = chart.chartArea, opts = chart.options, arcOpts = opts.elements.arc, @@ -144,7 +144,7 @@ module.exp...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/controllers/controller.line.js
@@ -260,7 +260,7 @@ module.exports = function(Chart) { draw: function(ease) { var me = this; - var meta = this.getMeta(); + var meta = me.getMeta(); var points = meta.data || []; var easingDecimal = ease || 1; var i, ilen;
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/controllers/controller.polarArea.js
@@ -106,32 +106,32 @@ module.exports = function(Chart) { linkScales: helpers.noop, update: function update(reset) { - var _this = this; - var chart = _this.chart; + var me = this; + var chart = me.chart; var chartArea = chart.chartArea; - var meta = _this.getMeta(); + var meta = me.getMeta(); ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/controllers/controller.radar.js
@@ -31,13 +31,14 @@ module.exports = function(Chart) { }, update: function update(reset) { - var meta = this.getMeta(); + var me = this; + var meta = me.getMeta(); var line = meta.dataset; var points = meta.data; var custom = line.custom || {}; - var dataset = this.getDataset(); - var line...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.animation.js
@@ -28,27 +28,28 @@ module.exports = function(Chart) { dropFrames: 0, request: null, addAnimation: function(chartInstance, animationObject, duration, lazy) { + var me = this; if (!lazy) { chartInstance.animating = true; } - for (var index = 0; index < this.animations.length; ++index) { - ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.controller.js
@@ -43,25 +43,26 @@ module.exports = function(Chart) { helpers.extend(Chart.Controller.prototype, { initialize: function initialize() { + var me = this; // Before init plugin notification - Chart.pluginService.notifyPlugins('beforeInit', [this]); + Chart.pluginService.notifyPlugins('beforeInit', [me]);...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.datasetController.js
@@ -25,25 +25,27 @@ module.exports = function(Chart) { dataElementType: null, initialize: function(chart, datasetIndex) { - this.chart = chart; - this.index = datasetIndex; - this.linkScales(); - this.addElements(); + var me = this; + me.chart = chart; + me.index = datasetIndex; + me.linkScales(...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.element.js
@@ -10,81 +10,90 @@ module.exports = function(Chart) { helpers.extend(this, configuration); this.initialize.apply(this, arguments); }; + helpers.extend(Chart.Element.prototype, { + initialize: function() { this.hidden = false; }, + pivot: function() { - if (!this._view) { - ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.legend.js
@@ -44,7 +44,7 @@ module.exports = function(Chart) { return helpers.isArray(data.datasets) ? data.datasets.map(function(dataset, i) { return { text: dataset.label, - fillStyle: dataset.backgroundColor, + fillStyle: (!helpers.isArray(dataset.backgroundColor) ? dataset.backgroundColor : datase...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.scale.js
@@ -59,51 +59,52 @@ module.exports = function(Chart) { helpers.callCallback(this.options.beforeUpdate, [this]); }, update: function(maxWidth, maxHeight, margins) { + var me = this; // Update Lifecycle - Probably don't want to ever extend or overwrite this function ;) - this.beforeUpdate(); + me.be...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.title.js
@@ -20,43 +20,50 @@ module.exports = function(Chart) { Chart.Title = Chart.Element.extend({ initialize: function(config) { - helpers.extend(this, config); - this.options = helpers.configMerge(Chart.defaults.global.title, config.options); + var me = this; + helpers.extend(me, config); + me.options = hel...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/core/core.tooltip.js
@@ -215,8 +215,7 @@ module.exports = function(Chart) { // Args are: (tooltipItem, data) getBeforeBody: function() { - var me = this; - var lines = me._options.callbacks.beforeBody.apply(me, arguments); + var lines = this._options.callbacks.beforeBody.apply(this, arguments); return helpers.isArray(line...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/elements/element.line.js
@@ -19,12 +19,13 @@ module.exports = function(Chart) { Chart.elements.Line = Chart.Element.extend({ lineToNextPoint: function(previousPoint, point, nextPoint, skipHandler, previousSkipHandler) { - var ctx = this._chart.ctx; + var me = this; + var ctx = me._chart.ctx; if (point._view.skip) { - skip...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.category.js
@@ -11,29 +11,31 @@ module.exports = function(Chart) { var DatasetScale = Chart.Scale.extend({ // Implement this so that determineDataLimits: function() { - this.minIndex = 0; - this.maxIndex = this.chart.data.labels.length - 1; + var me = this; + me.minIndex = 0; + me.maxIndex = me.chart.data.labels...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.linear.js
@@ -37,21 +37,21 @@ module.exports = function(Chart) { var LinearScale = Chart.LinearScaleBase.extend({ determineDataLimits: function() { - var _this = this; - var opts = _this.options; + var me = this; + var opts = me.options; var tickOpts = opts.ticks; - var chart = _this.chart; + var chart = m...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.linearbase.js
@@ -7,64 +7,64 @@ module.exports = function(Chart) { Chart.LinearScaleBase = Chart.Scale.extend({ handleTickRangeOptions: function() { - var _this = this; - var opts = _this.options; + var me = this; + var opts = me.options; var tickOpts = opts.ticks; // If we are forcing it to begin at 0, but ...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.logarithmic.js
@@ -23,21 +23,21 @@ module.exports = function(Chart) { var LogarithmicScale = Chart.Scale.extend({ determineDataLimits: function() { - var _this = this; - var opts = _this.options; + var me = this; + var opts = me.options; var tickOpts = opts.ticks; - var chart = _this.chart; + var chart = me.cha...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.radialLinear.js
@@ -99,10 +99,9 @@ module.exports = function(Chart) { me.handleTickRangeOptions(); }, getTickLimit: function() { - var me = this; - var tickOpts = me.options.ticks; + var tickOpts = this.options.ticks; var tickFontSize = helpers.getValueOrDefault(tickOpts.fontSize, globalDefaults.defaultFontSize); -...
true
Other
chartjs
Chart.js
5fae4dd3050fbd51da13ec1f5433d7f487758763.json
Change this -> me in source files This change allows for smaller minified code in the final version, resulting in a smaller file size. Some files had previously used _this, but that has been changed to me to keep consistency throughout the project.
src/scales/scale.time.js
@@ -79,227 +79,231 @@ module.exports = function(Chart) { return this.labelMoments[datasetIndex][index]; }, getMomentStartOf: function(tick) { - if (this.options.time.unit === 'week' && this.options.time.isoWeekday !== false) { - return tick.clone().startOf('isoWeek').isoWeekday(this.options.time.isoWeekd...
true
Other
chartjs
Chart.js
37249e4375dde042d573f1a18aabe188aa2de1fa.json
Fix an incorrect test setup
test/controller.line.tests.js
@@ -192,7 +192,7 @@ describe('Line controller tests', function() { chartArea: { bottom: 200, left: xScale.left, - right: 200, + right: xScale.left + 200, top: 0 }, data: data,
false
Other
chartjs
Chart.js
d61745a31155843fd0583f3c6c0a08673e0d4a93.json
Handle transitioning NaNs
src/core/core.element.js
@@ -38,7 +38,7 @@ // Init if doesn't exist else if (!this._view[key]) { - if (typeof value === 'number') { + if (typeof value === 'number' && isNaN(this._view[key]) === false) { this._view[key] = value * ease; } else { this._view[key] = value || null; @@ -61,14 +61,13 @@ } ...
true
Other
chartjs
Chart.js
d61745a31155843fd0583f3c6c0a08673e0d4a93.json
Handle transitioning NaNs
src/scales/scale.radialLinear.js
@@ -272,7 +272,10 @@ return index * angleMultiplier - (Math.PI / 2); }, getDistanceFromCenterForValue: function(value) { - if (value === null) return 0; // null always in center + if (value === null || value === undefined || isNaN(value)) { + return 0; // null always in center + } + // Take ...
true
Other
chartjs
Chart.js
05523b01b0207fd6d6ce00a45d8c6f773df4137d.json
Refactor the line drawing code. Tests are broken.
src/elements/element.line.js
@@ -31,87 +31,91 @@ Chart.elements.Line = Chart.Element.extend({ - draw: function() { - - var vm = this._view; + lineToNextPoint: function(previousPoint, point, nextPoint) { var ctx = this._chart.ctx; - var first = this._children[0]; - var last = this._children[this._children.length - 1]; - - ctx.sa...
false
Other
chartjs
Chart.js
3d15e1ff54045e7f449139a2fc8e70e29d558fd2.json
Update doc for options.ticks.maxTicksLimit
docs/01-Scales.md
@@ -209,6 +209,9 @@ The radial linear scale extends the core scale class with the following tick tem //Number - The backdrop padding to the side of the label in pixels backdropPaddingX: 2, + + //Number - Limit the maximum number of ticks + maxTicksLimit: 11, }, pointLabels: {
false
Other
chartjs
Chart.js
178880bace3a9091db8bd2bc3ac55b6c48552a70.json
Update doc for options.ticks.maxTicksLimit
docs/01-Scales.md
@@ -49,6 +49,7 @@ Chart.defaults.scale = { fontStyle: "normal", fontColor: "#666", fontFamily: "Helvetica Neue", + maxTicksLimit: 11, maxRotation: 90, minRotation: 20, mirror: false,
false
Other
chartjs
Chart.js
a5e382ab8af7064812300fb8c31856efd2755b7b.json
add composer file add composer file
composer.json
@@ -0,0 +1,26 @@ +{ + "name": "nnnick/chartjs", + "type": "library", + "description": "Simple HTML5 charts using the canvas element.", + "keywords": [ + "chart", + "js" + ], + "homepage": "http://www.chartjs.org/", + "license": "MIT", + "authors": [ + { + "name": ...
false
Other
chartjs
Chart.js
8324b35506459407cbfeacbbc5e66b2655823cba.json
Update linear scale + tests
src/scales/scale.linear.js
@@ -42,11 +42,21 @@ this.min = null; this.max = null; - var positiveValues = []; - var negativeValues = []; - if (this.options.stacked) { + var valuesPerType = {}; + helpers.each(this.data.datasets, function(dataset) { + if (valuesPerType[dataset.type] === undefined) { + valuesPerType...
true
Other
chartjs
Chart.js
8324b35506459407cbfeacbbc5e66b2655823cba.json
Update linear scale + tests
test/scale.linear.tests.js
@@ -188,13 +188,19 @@ describe('Linear Scale', function() { var mockData = { datasets: [{ yAxisID: scaleID, - data: [10, 5, 0, -5, 78, -100] + data: [10, 5, 0, -5, 78, -100], + type: 'bar' }, { yAxisID: 'second scale', data: [-1000, 1000], }, { yAxisID: scaleID, - data: [1...
true
Other
chartjs
Chart.js
53d13f70268105515cdb56c5ebe593a3c5bebadb.json
Try beta Chrome (#6933) * Try beta chrome * Update path
.travis.yml
@@ -3,7 +3,7 @@ node_js: - lts/* before_install: - - "export CHROME_BIN=/usr/bin/google-chrome" + - "export CHROME_BIN=/usr/bin/google-chrome-beta" services: - xvfb @@ -20,7 +20,7 @@ sudo: required dist: bionic addons: - chrome: stable + chrome: beta firefox: latest # IMPORTANT: scripts requir...
false
Other
chartjs
Chart.js
d04cdfc21fdb15948184bfe3a6f242a0ceec2e08.json
Add the ability to add a title to the legend (#6906) * Add the ability to add a title to the legend - Legend title can be specified - Font & color options added - Padding option added - Positioning option added - Legend title sample file added
docs/configuration/legend.md
@@ -19,6 +19,7 @@ The legend configuration is passed into the `options.legend` namespace. The glob | `labels` | `object` | | See the [Legend Label Configuration](#legend-label-configuration) section below. | `rtl` | `boolean` | | `true` for rendering the legends from right to left. | `textDirection` | `string` | can...
true
Other
chartjs
Chart.js
d04cdfc21fdb15948184bfe3a6f242a0ceec2e08.json
Add the ability to add a title to the legend (#6906) * Add the ability to add a title to the legend - Legend title can be specified - Font & color options added - Padding option added - Positioning option added - Legend title sample file added
samples/legend/title.html
@@ -0,0 +1,153 @@ +<!doctype html> +<html> + +<head> + <title>Legend Positions</title> + <script src="../../dist/Chart.min.js"></script> + <script src="../utils.js"></script> + <style> + canvas { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + } + .chart-container { + width:...
true
Other
chartjs
Chart.js
d04cdfc21fdb15948184bfe3a6f242a0ceec2e08.json
Add the ability to add a title to the legend (#6906) * Add the ability to add a title to the legend - Legend title can be specified - Font & color options added - Padding option added - Positioning option added - Legend title sample file added
samples/samples.js
@@ -163,6 +163,9 @@ items: [{ title: 'Positioning', path: 'legend/positioning.html' + }, { + title: 'Legend Title', + path: 'legend/title.html' }, { title: 'Point style', path: 'legend/point-style.html'
true
Other
chartjs
Chart.js
d04cdfc21fdb15948184bfe3a6f242a0ceec2e08.json
Add the ability to add a title to the legend (#6906) * Add the ability to add a title to the legend - Legend title can be specified - Font & color options added - Padding option added - Positioning option added - Legend title sample file added
src/plugins/plugin.legend.js
@@ -72,6 +72,12 @@ defaults._set('legend', { }; }, this); } + }, + + title: { + display: false, + position: 'center', + text: '', } }); @@ -210,21 +216,21 @@ class Legend extends Element { beforeFit() {} fit() { - var me = this; - var opts = me.options; - var labelOpts = opts.labels; - var...
true
Other
chartjs
Chart.js
d04cdfc21fdb15948184bfe3a6f242a0ceec2e08.json
Add the ability to add a title to the legend (#6906) * Add the ability to add a title to the legend - Legend title can be specified - Font & color options added - Padding option added - Positioning option added - Legend title sample file added
test/specs/plugin.legend.tests.js
@@ -20,6 +20,12 @@ describe('Legend block tests', function() { boxWidth: 40, padding: 10, generateLabels: jasmine.any(Function) + }, + + title: { + display: false, + position: 'center', + text: '', } }); });
true
Other
chartjs
Chart.js
547aa515440def05a3c2ab998919faead7d102f5.json
Draw active points last (#6944)
src/controllers/controller.line.js
@@ -164,16 +164,26 @@ export default DatasetController.extend({ const meta = me._cachedMeta; const points = meta.data || []; const area = chart.chartArea; - const ilen = points.length; - let i = 0; + const active = []; + let ilen = points.length; + let i, point; if (me._showLine) { meta.dataset.d...
true
Other
chartjs
Chart.js
547aa515440def05a3c2ab998919faead7d102f5.json
Draw active points last (#6944)
src/core/core.datasetController.js
@@ -1006,6 +1006,7 @@ helpers.extend(DatasetController.prototype, { * @private */ _setStyle(element, index, mode, active) { + element.active = active; this._resolveAnimations(index, mode, active).update(element, {options: this.getStyle(index, active)}); },
true
Other
chartjs
Chart.js
8d7d5571cfc99e9ebd3466e9a7c40157e46e9ce3.json
Update moment to 2.24 in samples (#6948)
samples/scales/time/combo.html
@@ -3,7 +3,7 @@ <head> <title>Line Chart - Combo Time Scale</title> - <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script> <script src="../../../dist/Chart.min.js"></script> <script src="...
true
Other
chartjs
Chart.js
8d7d5571cfc99e9ebd3466e9a7c40157e46e9ce3.json
Update moment to 2.24 in samples (#6948)
samples/scales/time/financial.html
@@ -3,7 +3,7 @@ <head> <title>Line Chart</title> - <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.18.1/moment.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script> <script src="../../../dist/Chart.min.js"></script> <script src="../../utils.js"></s...
true
Other
chartjs
Chart.js
8d7d5571cfc99e9ebd3466e9a7c40157e46e9ce3.json
Update moment to 2.24 in samples (#6948)
samples/scales/time/line-point-data.html
@@ -3,7 +3,7 @@ <head> <title>Time Scale Point Data</title> - <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script> <script src="../../../dist/Chart.min.js"></script> <script src="../../ut...
true
Other
chartjs
Chart.js
8d7d5571cfc99e9ebd3466e9a7c40157e46e9ce3.json
Update moment to 2.24 in samples (#6948)
samples/scales/time/line.html
@@ -3,7 +3,7 @@ <head> <title>Line Chart</title> - <script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.13.0/moment.min.js"></script> + <script src="https://cdn.jsdelivr.net/npm/moment@2.24.0/moment.min.js"></script> <script src="../../../dist/Chart.min.js"></script> <script src="../../utils.js"></s...
true
Other
chartjs
Chart.js
404c1a08c7ac4fae4a3711c850ca610815349116.json
Fix broken config in log scatter sample (#6937)
samples/scales/logarithmic/scatter.html
@@ -137,7 +137,7 @@ type: 'logarithmic', position: 'bottom', ticks: { - userCallback: function(tick) { + callback: function(tick) { var remain = tick / (Math.pow(10, Math.floor(Chart.helpers.math.log10(tick)))); if (remain === 1 || remain === 2 || remain === 5) { ...
false
Other
chartjs
Chart.js
a0dd9566c39348028f41d77db4e8c4f653c644b0.json
Upgrade Ubuntu on Travis to match GitHub actions (#6932)
.travis.yml
@@ -17,6 +17,7 @@ script: - cat ./coverage/lcov.info | ./node_modules/.bin/coveralls || true sudo: required +dist: bionic addons: chrome: stable
false
Other
chartjs
Chart.js
2dd0c2f8feb8eef45e0b077ffa9a648d0c1229c6.json
Remove futile optimization (#6928)
src/controllers/controller.bubble.js
@@ -125,9 +125,8 @@ module.exports = DatasetController.extend({ const firstOpts = me._resolveDataElementOptions(start, mode); const sharedOptions = me._getSharedOptions(mode, points[start], firstOpts); const includeOptions = me._includeOptions(mode, sharedOptions); - let i; - for (i = 0; i < points.length;...
true
Other
chartjs
Chart.js
2dd0c2f8feb8eef45e0b077ffa9a648d0c1229c6.json
Remove futile optimization (#6928)
src/controllers/controller.line.js
@@ -98,9 +98,8 @@ module.exports = DatasetController.extend({ const firstOpts = me._resolveDataElementOptions(start, mode); const sharedOptions = me._getSharedOptions(mode, points[start], firstOpts); const includeOptions = me._includeOptions(mode, sharedOptions); - let i; - for (i = 0; i < points.length; +...
true
Other
chartjs
Chart.js
9cb65d2c97136dab4e6ed8f44f3d3d5dd2cda88b.json
Add API to change data visibility (#6907)
docs/developers/api.md
@@ -147,3 +147,21 @@ Extensive examples of usage are available in the [Chart.js tests](https://github var meta = myChart.getDatasetMeta(0); var x = meta.data[0].x; ``` + +## setDatasetVisibility(datasetIndex, visibility) + +Sets the visibility for a given dataset. This can be used to build a chart legend in HTML. Du...
true
Other
chartjs
Chart.js
9cb65d2c97136dab4e6ed8f44f3d3d5dd2cda88b.json
Add API to change data visibility (#6907)
src/core/core.controller.js
@@ -810,6 +810,19 @@ class Chart { return typeof meta.hidden === 'boolean' ? !meta.hidden : !this.data.datasets[datasetIndex].hidden; } + setDatasetVisibility(datasetIndex, visible) { + const meta = this.getDatasetMeta(datasetIndex); + meta.hidden = !visible; + } + + setDataVisibility(datasetIndex, index, visi...
true
Other
chartjs
Chart.js
9cb65d2c97136dab4e6ed8f44f3d3d5dd2cda88b.json
Add API to change data visibility (#6907)
test/specs/core.controller.tests.js
@@ -1347,4 +1347,39 @@ describe('Chart', function() { expect(metasets[3].order).toEqual(3); }); }); + + describe('data visibility', function() { + it('should hide a dataset', function() { + var chart = acquireChart({ + type: 'line', + data: { + datasets: [{ + data: [0, 1, 2] + }], + l...
true
Other
chartjs
Chart.js
ac85ce41db282368de50cf7dfdb9cf386cbfbf62.json
Handle font sizes that are set as strings (#6921)
src/helpers/helpers.options.js
@@ -90,8 +90,13 @@ export function toPadding(value) { * @private */ export function _parseFont(options) { - var size = valueOrDefault(options.fontSize, defaults.fontSize); - var font = { + let size = valueOrDefault(options.fontSize, defaults.fontSize); + + if (typeof size === 'string') { + size = parseInt(size, 1...
true
Other
chartjs
Chart.js
ac85ce41db282368de50cf7dfdb9cf386cbfbf62.json
Handle font sizes that are set as strings (#6921)
test/specs/helpers.options.tests.js
@@ -113,6 +113,21 @@ describe('Chart.helpers.options', function() { weight: null }); }); + it ('should handle a string font size', function() { + expect(parseFont({ + fontFamily: 'bla', + lineHeight: 8, + fontSize: '21', + fontStyle: 'zzz' + })).toEqual({ + family: 'bla', + lineHeight...
true