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 | 4b4b4b79e1e24d2f8e253abbe365a34021a29b79.json | Convert all scales to use ES6 classes | src/scales/scale.linearbase.js | @@ -1,9 +1,9 @@
'use strict';
-var helpers = require('../helpers/index');
-var Scale = require('../core/core.scale');
+const helpers = require('../helpers/index');
+const Scale = require('../core/core.scale');
-var isNullOrUndef = helpers.isNullOrUndef;
+const isNullOrUndef = helpers.isNullOrUndef;
/**
* Gene... | true |
Other | chartjs | Chart.js | 4b4b4b79e1e24d2f8e253abbe365a34021a29b79.json | Convert all scales to use ES6 classes | src/scales/scale.logarithmic.js | @@ -1,13 +1,13 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var helpers = require('../helpers/index');
-var Scale = require('../core/core.scale');
-var LinearScaleBase = require('./scale.linearbase');
-var Ticks = require('../core/core.ticks');
+const defaults = require('../core/core.defaults'... | true |
Other | chartjs | Chart.js | 4b4b4b79e1e24d2f8e253abbe365a34021a29b79.json | Convert all scales to use ES6 classes | src/scales/scale.radialLinear.js | @@ -1,15 +1,15 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var helpers = require('../helpers/index');
-var LinearScaleBase = require('./scale.linearbase');
-var Ticks = require('../core/core.ticks');
+const defaults = require('../core/core.defaults');
+const helpers = require('../helpers/inde... | true |
Other | chartjs | Chart.js | 4b4b4b79e1e24d2f8e253abbe365a34021a29b79.json | Convert all scales to use ES6 classes | src/scales/scale.time.js | @@ -1,17 +1,17 @@
'use strict';
-var adapters = require('../core/core.adapters');
-var defaults = require('../core/core.defaults');
-var helpers = require('../helpers/index');
-var Scale = require('../core/core.scale');
+const adapters = require('../core/core.adapters');
+const defaults = require('../core/core.defau... | true |
Other | chartjs | Chart.js | 8f0de52c4e446b33c4dbcf0e738f67eabdd43f6d.json | Remove moment from dependencies (#6745)
* Remove moment from dependencies
* Remove version number in docs | docs/axes/cartesian/time.md | @@ -4,7 +4,7 @@ The time scale is used to display times and dates. When building its ticks, it w
## Date Adapters
-The time scale requires both a date library and corresponding adapter to be present. By default, Chart.js includes an adapter for Moment.js. You may wish to [exclude moment](../../getting-started/inte... | true |
Other | chartjs | Chart.js | 8f0de52c4e446b33c4dbcf0e738f67eabdd43f6d.json | Remove moment from dependencies (#6745)
* Remove moment from dependencies
* Remove version number in docs | docs/getting-started/integration.md | @@ -25,26 +25,6 @@ import Chart from 'chart.js';
var myChart = new Chart(ctx, {...});
```
-**Note:** Moment.js is installed along Chart.js as dependency. If you don't want to use Moment.js (either because you use a different date adapter or simply because don't need time functionalities), you will have to configure... | true |
Other | chartjs | Chart.js | 8f0de52c4e446b33c4dbcf0e738f67eabdd43f6d.json | Remove moment from dependencies (#6745)
* Remove moment from dependencies
* Remove version number in docs | docs/getting-started/v3-migration.md | @@ -2,11 +2,12 @@
Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released in April 2016. In the years since then, as Chart.js has grown in popularity and feature set, we've learned some lessons about how to better create a charting library. In order to improve performance, offer new features,... | true |
Other | chartjs | Chart.js | 8f0de52c4e446b33c4dbcf0e738f67eabdd43f6d.json | Remove moment from dependencies (#6745)
* Remove moment from dependencies
* Remove version number in docs | package-lock.json | @@ -6843,7 +6843,8 @@
"moment": {
"version": "2.24.0",
"resolved": "https://registry.npmjs.org/moment/-/moment-2.24.0.tgz",
- "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSWj/0e7jQcy87A8e7o2nAfP/34/2ky5Vw4B9S446EtIhodAzkFCcR4dQg=="
+ "integrity": "sha512-bV7f+6l2QigeBBZSM/6yTNq4P2fNpSW... | true |
Other | chartjs | Chart.js | 8f0de52c4e446b33c4dbcf0e738f67eabdd43f6d.json | Remove moment from dependencies (#6745)
* Remove moment from dependencies
* Remove version number in docs | package.json | @@ -61,6 +61,7 @@
"karma-rollup-preprocessor": "^7.0.0",
"karma-safari-private-launcher": "^1.0.0",
"merge-stream": "^1.0.1",
+ "moment": "^2.10.2",
"pixelmatch": "^5.0.0",
"rollup": "^1.0.0",
"rollup-plugin-babel": "^4.3.3",
@@ -71,7 +72,6 @@
"yargs": "^14.0.0"
},
"dependenc... | true |
Other | chartjs | Chart.js | fef2a13ef6f89e09d78b77930faa9d1208b978d2.json | Update time combo sample (#6736) | samples/scales/time/combo.html | @@ -27,68 +27,45 @@
<button id="addData">Add Data</button>
<button id="removeData">Remove Data</button>
<script>
- var timeFormat = 'MM/DD/YYYY HH:mm';
+ function newDate(days) {
+ return moment().startOf('day').add(days, 'd').valueOf();
+ }
- function newDateString(days) {
- return moment().add(days, '... | false |
Other | chartjs | Chart.js | 91466ae358b9adec11e26e5d5e5149a73f1fcb44.json | Remove remaingin zeroLine* references (#6728) | samples/charts/scatter/multi-axis.html | @@ -97,9 +97,6 @@
scales: {
xAxes: [{
position: 'bottom',
- gridLines: {
- zeroLineColor: 'rgba(0,0,0,1)'
- }
}],
yAxes: [{
type: 'linear', // only linear but allow scale type registration. This allows extensions to exist solely for log scale for instance | true |
Other | chartjs | Chart.js | 91466ae358b9adec11e26e5d5e5149a73f1fcb44.json | Remove remaingin zeroLine* references (#6728) | test/fixtures/core.scale/tick-drawing.json | @@ -46,8 +46,7 @@
"gridLines":{
"drawOnChartArea": false,
"drawBorder": false,
- "color": "rgba(0, 0, 0, 1)",
- "zeroLineColor": "rgba(0, 0, 0, 1)"
+ "color": "rgba(0, 0, 0, 1)"
... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | docs/getting-started/v3-migration.md | @@ -106,3 +106,17 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
##### Time Scale
* `getValueForPixel` now returns milliseconds since the epoch
+
+#### Controllers
+
+##### Core Controller
+
+* The first parameter to `updateHoverStyle` is now an array of objects containing the `... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.bar.js | @@ -240,8 +240,6 @@ module.exports = DatasetController.extend({
var me = this;
var options = me._resolveDataElementOptions(index);
- rectangle._datasetIndex = me.index;
- rectangle._index = index;
rectangle._model = {
backgroundColor: options.backgroundColor,
borderColor: options.borderColor, | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.bubble.js | @@ -107,8 +107,6 @@ module.exports = DatasetController.extend({
var y = reset ? yScale.getBasePixel() : yScale.getPixelForValue(parsed[yScale.id]);
point._options = options;
- point._datasetIndex = me.index;
- point._index = index;
point._model = {
backgroundColor: options.backgroundColor,
borderCo... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.doughnut.js | @@ -238,10 +238,6 @@ module.exports = DatasetController.extend({
var options = arc._options || {};
helpers.extend(arc, {
- // Utility
- _datasetIndex: me.index,
- _index: index,
-
// Desired view properties
_model: {
backgroundColor: options.backgroundColor, | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.line.js | @@ -82,8 +82,6 @@ module.exports = DatasetController.extend({
// Update Line
if (showLine) {
- // Utility
- line._datasetIndex = me.index;
// Data
line._children = points;
// Model
@@ -110,7 +108,6 @@ module.exports = DatasetController.extend({
updateElement: function(point, index, reset) {
... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.polarArea.js | @@ -201,10 +201,6 @@ module.exports = DatasetController.extend({
var options = arc._options || {};
helpers.extend(arc, {
- // Utility
- _datasetIndex: me.index,
- _index: index,
-
// Desired view properties
_model: {
backgroundColor: options.backgroundColor, | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/controllers/controller.radar.js | @@ -83,8 +83,6 @@ module.exports = DatasetController.extend({
config.lineTension = config.tension;
}
- // Utility
- line._datasetIndex = me.index;
// Data
line._children = points;
line._loop = true;
@@ -119,8 +117,6 @@ module.exports = DatasetController.extend({
// Utility
point._options = o... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/core/core.controller.js | @@ -980,19 +980,24 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
});
},
- updateHoverStyle: function(elements, mode, enabled) {
+ updateHoverStyle: function(items, mode, enabled) {
var prefix = enabled ? 'set' : 'remove';
- var element, i, ilen;
+ var meta, item, i, ilen;
- for (i = 0, ilen = ... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/core/core.datasetController.js | @@ -793,9 +793,8 @@ helpers.extend(DatasetController.prototype, {
delete element.$previousStyle;
},
- setHoverStyle: function(element) {
- var dataset = this.chart.data.datasets[element._datasetIndex];
- var index = element._index;
+ setHoverStyle: function(element, datasetIndex, index) {
+ var dataset = this... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/core/core.element.js | @@ -56,12 +56,13 @@ class Element {
constructor(configuration) {
helpers.extend(this, configuration);
+
+ // this.hidden = false; we assume Element has an attribute called hidden, but do not initialize to save memory
+
this.initialize.apply(this, arguments);
}
- initialize() {
- this.hidden = false;
- }... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/core/core.interaction.js | @@ -33,7 +33,7 @@ function parseVisibleItems(chart, handler) {
for (j = 0, jlen = metadata.length; j < jlen; ++j) {
element = metadata[j];
if (!element._view.skip) {
- handler(element);
+ handler(element, i, j);
}
}
}
@@ -48,9 +48,9 @@ function parseVisibleItems(chart, handler) {
function get... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/core/core.tooltip.js | @@ -117,7 +117,7 @@ var positioners = {
var count = 0;
for (i = 0, len = elements.length; i < len; ++i) {
- var el = elements[i];
+ var el = elements[i].element;
if (el && el.hasValue()) {
var pos = el.tooltipPosition();
x += pos.x;
@@ -146,7 +146,7 @@ var positioners = {
var i, len, neares... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | src/helpers/helpers.core.js | @@ -164,6 +164,31 @@ var helpers = {
return true;
},
+ /**
+ * Returns true if the `a0` and `a1` arrays have the same content, else returns false.
+ * @param {Array} a0 - The array to compare
+ * @param {Array} a1 - The array to compare
+ * @returns {boolean}
+ */
+ _elementsEqual: function(a0, a1) {
+ let... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | test/specs/controller.bar.tests.js | @@ -1379,7 +1379,7 @@ describe('Chart.controllers.bar', function() {
var meta = chart.getDatasetMeta(1);
var bar = meta.data[0];
- meta.controller.setHoverStyle(bar);
+ meta.controller.setHoverStyle(bar, 1, 0);
expect(bar._model.backgroundColor).toBe('rgb(230, 0, 0)');
expect(bar._model.borderColor).toB... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | test/specs/core.controller.tests.js | @@ -1168,13 +1168,13 @@ describe('Chart', function() {
// Check and see if tooltip was displayed
var tooltip = chart.tooltip;
- expect(chart.lastActive).toEqual([point]);
- expect(tooltip._lastActive).toEqual([point]);
+ expect(chart.lastActive[0].element).toEqual(point);
+ expect(tooltip._lastActive[... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | test/specs/core.interaction.tests.js | @@ -37,7 +37,7 @@ describe('Core.Interaction', function() {
y: point._model.y,
};
- var elements = Chart.Interaction.modes.point(chart, evt);
+ var elements = Chart.Interaction.modes.point(chart, evt).map(item => item.element);
expect(elements).toEqual([point, meta1.data[1]]);
});
@@ -51,7 +51,7... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | test/specs/global.defaults.tests.js | @@ -18,7 +18,7 @@ describe('Default Configs', function() {
});
// fake out the tooltip hover and force the tooltip to update
- chart.tooltip._active = [chart.getDatasetMeta(0).data[0]];
+ chart.tooltip._active = [{element: chart.getDatasetMeta(0).data[0], datasetIndex: 0, index: 0}];
chart.tooltip.upd... | true |
Other | chartjs | Chart.js | a3392e0e59ae77a9c081b4c14de2c95a35422e18.json | Remove index and datasetIndex from Element (#6688)
Remove `index` and `datasetIndex` properties from elements. | test/specs/helpers.core.tests.js | @@ -264,6 +264,18 @@ describe('Chart.helpers.core', function() {
});
});
+ describe('_elementsEqual', function() {
+ it('should return true if arrays are the same', function() {
+ expect(helpers._elementsEqual(
+ [{datasetIndex: 0, index: 1}, {datasetIndex: 0, index: 2}],
+ [{datasetIndex: 0, index: 1},... | true |
Other | chartjs | Chart.js | 46aff21a3d5b8391c1f0204b6fe2a33c20de8cd0.json | Fix undefined variable (#6699) | src/core/core.scale.js | @@ -400,7 +400,7 @@ class Scale extends Element {
*/
_getLabels() {
var data = this.chart.data;
- return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels;
+ return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];
}
/... | false |
Other | chartjs | Chart.js | fcf76c5edd244a8a0a35b862cbe0db472a2caa46.json | Fix sample paths and include all options (#6712) | samples/scales/axes-labels.html | @@ -3,8 +3,8 @@
<head>
<title>Line Chart</title>
- <script src="../../../dist/Chart.min.js"></script>
- <script src="../../utils.js"></script>
+ <script src="../../dist/Chart.min.js"></script>
+ <script src="../utils.js"></script>
<style>
canvas{
-moz-user-select: none;
@@ -80,14 +80,26 @@
display: t... | false |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/core/core.animation.js | @@ -1,16 +1,24 @@
'use strict';
-var Element = require('./core.element');
+const Element = require('./core.element');
+const helpers = require('../helpers/index');
-var exports = Element.extend({
- chart: null, // the animation associated chart instance
- currentStep: 0, // the current animation step
- numSteps: 6... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/core/core.element.js | @@ -1,7 +1,7 @@
'use strict';
-var color = require('chartjs-color');
-var helpers = require('../helpers/index');
+const color = require('chartjs-color');
+const helpers = require('../helpers/index');
function interpolate(start, view, model, ease) {
var keys = Object.keys(model);
@@ -52,28 +52,27 @@ function int... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/core/core.scale.js | @@ -1,14 +1,14 @@
'use strict';
-var defaults = require('./core.defaults');
-var Element = require('./core.element');
-var helpers = require('../helpers/index');
-var Ticks = require('./core.ticks');
+const defaults = require('./core.defaults');
+const Element = require('./core.element');
+const helpers = require('.... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/core/core.tooltip.js | @@ -1,11 +1,11 @@
'use strict';
-var defaults = require('./core.defaults');
-var Element = require('./core.element');
-var helpers = require('../helpers/index');
+const defaults = require('./core.defaults');
+const Element = require('./core.element');
+const helpers = require('../helpers/index');
-var valueOrDefau... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/elements/element.arc.js | @@ -1,9 +1,9 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
-var TAU = Math.PI * 2;
+const defaults = require('../core/core.defaults');
+const Element = require('../core/core.element');
+const helpers = re... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/elements/element.line.js | @@ -1,12 +1,12 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
+const defaults = require('../core/core.defaults');
+const Element = require('../core/core.element');
+const helpers = require('../helpers/inde... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/elements/element.point.js | @@ -1,12 +1,12 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
+const defaults = require('../core/core.defaults');
+const Element = require('../core/core.element');
+const helpers = require('../helpers/inde... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/elements/element.rectangle.js | @@ -1,10 +1,10 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
+const defaults = require('../core/core.defaults');
+const Element = require('../core/core.element');
+const helpers = require('../helpers/inde... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/plugins/plugin.legend.js | @@ -1,13 +1,12 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
-var layouts = require('../core/core.layouts');
+const defaults = require('../core/core.defaults');
+const Element = require('../core/core.elem... | true |
Other | chartjs | Chart.js | 4a8a7ee8247c7c69e7e5f0a9388cdeb07e4fc197.json | Use ES6 classes for elements (#6702)
* Use ES6 classes for elements
* Add additional elements | src/plugins/plugin.title.js | @@ -1,11 +1,9 @@
'use strict';
-var defaults = require('../core/core.defaults');
-var Element = require('../core/core.element');
-var helpers = require('../helpers/index');
-var layouts = require('../core/core.layouts');
-
-var noop = helpers.noop;
+const defaults = require('../core/core.defaults');
+const Element =... | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | docs/axes/styling.md | @@ -18,10 +18,6 @@ The grid line configuration is nested under the scale configuration in the `grid
| `drawOnChartArea` | `boolean` | `true` | If true, draw lines on the chart area inside the axis lines. This is useful when there are multiple axes and you need to control which grid lines are drawn.
| `drawTicks` | `b... | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | docs/getting-started/v3-migration.md | @@ -26,6 +26,7 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
### Customizability
* `custom` attribute of elements was removed. Please use scriptable options
+* The `zeroLine*` options of axes were removed.
### Options
| true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | src/core/core.scale.js | @@ -24,10 +24,6 @@ defaults._set('scale', {
drawOnChartArea: true,
drawTicks: true,
tickMarkLength: 10,
- zeroLineWidth: 1,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
offsetGridLines: false,
borderDash: [],
borderDashOffset: 0.0
@@ -324,9 +320,6... | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | src/scales/scale.linearbase.js | @@ -234,8 +234,6 @@ module.exports = Scale.extend({
generateTickLabels: function(ticks) {
var me = this;
me._tickValues = ticks.map(t => t.value);
- me.zeroLineIndex = me._tickValues.indexOf(0);
-
Scale.prototype.generateTickLabels.call(me, ticks);
},
| true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/fixtures/core.scale/tick-drawing.json | @@ -19,8 +19,7 @@
"gridLines":{
"drawOnChartArea": false,
"drawBorder": false,
- "color": "rgba(0, 0, 0, 1)",
- "zeroLineColor": "rgba(0, 0, 0, 1)"
+ "color": "rgba(0, 0, 0, 1)"
... | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/specs/scale.category.tests.js | @@ -29,10 +29,6 @@ describe('Category scale tests', function() {
lineWidth: 1,
offsetGridLines: false,
display: true,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineWidth: 1,
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
borderDash: [],
borderDashOffset: 0.0
}, | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/specs/scale.linear.tests.js | @@ -23,10 +23,6 @@ describe('Linear Scale', function() {
lineWidth: 1,
offsetGridLines: false,
display: true,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineWidth: 1,
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
borderDash: [],
borderDashOffset: 0.0
}, | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/specs/scale.logarithmic.tests.js | @@ -22,10 +22,6 @@ describe('Logarithmic Scale tests', function() {
lineWidth: 1,
offsetGridLines: false,
display: true,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineWidth: 1,
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
borderDash: [],
borderDashOffset: 0.0
}, | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/specs/scale.radialLinear.tests.js | @@ -34,10 +34,6 @@ describe('Test the radial linear scale', function() {
lineWidth: 1,
offsetGridLines: false,
display: true,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineWidth: 1,
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
borderDash: [],
borderDashOffset: 0.0
... | true |
Other | chartjs | Chart.js | 94afa634507036d8cd6b34d2c96eb225177b197e.json | Remove zeroLineIndex functionality (#6697)
* Remove zeroLineIndex functionality
* Remove docs
* Code review updates | test/specs/scale.time.tests.js | @@ -69,10 +69,6 @@ describe('Time scale tests', function() {
lineWidth: 1,
offsetGridLines: false,
display: true,
- zeroLineColor: 'rgba(0,0,0,0.25)',
- zeroLineWidth: 1,
- zeroLineBorderDash: [],
- zeroLineBorderDashOffset: 0.0,
borderDash: [],
borderDashOffset: 0.0
}, | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | .github/workflows/ci.yml | @@ -0,0 +1,49 @@
+name: CI
+
+on: [push]
+
+jobs:
+ build:
+ runs-on: ${{ matrix.os }}
+
+ strategy:
+ matrix:
+ os: [ubuntu-latest, windows-latest, macos-latest]
+ fail-fast: false
+
+ steps:
+ - uses: actions/checkout@v1
+ - name: Use Node.js
+ uses: actions/setup-node@v1
+ - ... | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | docs/developers/contributing.md | @@ -36,6 +36,7 @@ The following commands are now available from the repository root:
> gulp unittest --coverage // run tests and generate coverage reports in ./coverage
> gulp lint // perform code linting (ESLint)
> gulp test // perform code linting and run unit tests
+> gulp test --... | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | gulpfile.js | @@ -145,6 +145,7 @@ function unittestTask(done) {
args: {
coverage: !!argv.coverage,
inputs: (argv.inputs || 'test/specs/**/*.js').split(';'),
+ browsers: (argv.browsers || 'chrome,firefox').split(','),
watch: argv.watch
}
}, | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | karma.conf.js | @@ -22,7 +22,7 @@ module.exports = function(karma) {
karma.set({
frameworks: ['jasmine'],
reporters: ['progress', 'kjhtml'],
- browsers: ['chrome', 'firefox'],
+ browsers: args.browsers,
logLevel: karma.LOG_WARN,
// Explicitly disable hardware acceleration to make image
@@ -40,6 +40,12 @@ module.expor... | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | package-lock.json | @@ -938,6 +938,12 @@
"buffer-equal": "^1.0.0"
}
},
+ "applescript": {
+ "version": "1.0.0",
+ "resolved": "https://registry.npmjs.org/applescript/-/applescript-1.0.0.tgz",
+ "integrity": "sha1-u4evVoytA0pOSMS9r2Bno6JwExc=",
+ "dev": true
+ },
"archy": {
"versio... | true |
Other | chartjs | Chart.js | aff7d411404fe3499b9cd11333fb45d5922cdf91.json | Add cross-platform CI (#6670)
* Linux and Windows CI with GitHub Actions
* Add karma-edge-launcher
* Add edge configuration to karma.conf.js
* Support --browsers on the command line for karma tests
* Add macOS CI builds
* Add karma-safari-private-launcher
* Document browser specification for tests | package.json | @@ -53,10 +53,12 @@
"karma": "^4.0.0",
"karma-chrome-launcher": "^3.0.0",
"karma-coverage": "^2.0.0",
+ "karma-edge-launcher": "^0.4.2",
"karma-firefox-launcher": "^1.0.1",
"karma-jasmine": "^2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"karma-rollup-preprocessor": "^7.0.0",
+ ... | true |
Other | chartjs | Chart.js | b90552b9ca851bf8567acca5176597e6f316a68f.json | Remove check that is always true (#6701) | src/core/core.scale.js | @@ -1012,11 +1012,6 @@ var Scale = Element.extend({
for (i = 0; i < ticksLength; ++i) {
tick = ticks[i] || {};
- // autoskipper skipped this tick (#4635)
- if (isNullOrUndef(tick.label) && i < ticks.length) {
- continue;
- }
-
if (i === me.zeroLineIndex && options.offset === offsetGridLines) {
... | false |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | docs/getting-started/v3-migration.md | @@ -66,6 +66,11 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
* Made `scale.handleDirectionalChanges` private
* Made `scale.tickValues` private
+#### Removal of private APIs
+
+* `_model.datasetLabel`
+* `_model.label`
+
### Renamed
* `helpers.clear` was renamed to `helpers... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | src/controllers/controller.bar.js | @@ -238,7 +238,6 @@ module.exports = DatasetController.extend({
updateElement: function(rectangle, index, reset) {
var me = this;
- var dataset = me.getDataset();
var options = me._resolveDataElementOptions(index);
rectangle._datasetIndex = me.index;
@@ -247,9 +246,7 @@ module.exports = DatasetControlle... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | src/controllers/controller.doughnut.js | @@ -232,7 +232,6 @@ module.exports = DatasetController.extend({
var centerY = (chartArea.top + chartArea.bottom) / 2;
var startAngle = opts.rotation; // non reset case handled later
var endAngle = opts.rotation; // non reset case handled later
- var dataset = me.getDataset();
var circumference = reset && a... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | src/controllers/controller.polarArea.js | @@ -187,7 +187,6 @@ module.exports = DatasetController.extend({
var opts = chart.options;
var animationOpts = opts.animation;
var scale = chart.scale;
- var labels = chart.data.labels;
var centerX = scale.xCenter;
var centerY = scale.yCenter;
@@ -217,8 +216,7 @@ module.exports = DatasetController.exte... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | test/specs/controller.bar.tests.js | @@ -746,8 +746,6 @@ describe('Chart.controllers.bar', function() {
expect(meta.data[i]._model.base).toBeCloseToPixel(1024);
expect(meta.data[i]._model.width).toBeCloseToPixel(46);
expect(meta.data[i]._model).toEqual(jasmine.objectContaining({
- datasetLabel: chart.data.datasets[1].label,
- label: char... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | test/specs/controller.doughnut.tests.js | @@ -114,7 +114,6 @@ describe('Chart.controllers.doughnut', function() {
expect(meta.data[i]._model).toEqual(jasmine.objectContaining({
startAngle: Math.PI * -0.5,
endAngle: Math.PI * -0.5,
- label: chart.data.labels[i],
backgroundColor: 'rgb(255, 0, 0)',
borderColor: 'rgb(0, 0, 255)',
bo... | true |
Other | chartjs | Chart.js | e42413f3e81703aae14272198a5b4ec54136bc15.json | Remove unused model properties (#6691)
* Remove unused model properties
* Add to migration guide | test/specs/controller.polarArea.tests.js | @@ -117,8 +117,7 @@ describe('Chart.controllers.polarArea', function() {
expect(meta.data[i]._model).toEqual(jasmine.objectContaining({
backgroundColor: 'rgb(255, 0, 0)',
borderColor: 'rgb(0, 255, 0)',
- borderWidth: 1.2,
- label: chart.data.labels[i]
+ borderWidth: 1.2
}));
});
@@ -186,... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | docs/getting-started/v3-migration.md | @@ -53,13 +53,16 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
* `helpers.numberOfLabelLines`
* `helpers.removeEvent`
* `helpers.scaleMerge`
-* `scale.getRightValue`
-* `scale.mergeTicksOptions`
-* `scale.ticksAsNumbers`
+* `Scale.getRightValue`
+* `Scale.mergeTicksOptions`
+* `... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | src/elements/element.arc.js | @@ -94,15 +94,6 @@ function drawBorder(ctx, vm, arc) {
module.exports = Element.extend({
_type: 'arc',
- inLabelRange: function(mouseX) {
- var vm = this._view;
-
- if (vm) {
- return (Math.pow(mouseX - vm.x, 2) < Math.pow(vm.radius + vm.hoverRadius, 2));
- }
- return false;
- },
-
inRange: function(chartX... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | src/elements/element.point.js | @@ -42,7 +42,6 @@ module.exports = Element.extend({
return vm ? ((Math.pow(mouseX - vm.x, 2) + Math.pow(mouseY - vm.y, 2)) < Math.pow(vm.hitRadius + vm.radius, 2)) : false;
},
- inLabelRange: xRange,
inXRange: xRange,
inYRange: yRange,
@@ -54,10 +53,6 @@ module.exports = Element.extend({
};
},
- get... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | src/elements/element.rectangle.js | @@ -157,22 +157,10 @@ module.exports = Element.extend({
ctx.restore();
},
- height: function() {
- var vm = this._view;
- return vm.base - vm.y;
- },
-
inRange: function(mouseX, mouseY) {
return inRange(this._view, mouseX, mouseY);
},
- inLabelRange: function(mouseX, mouseY) {
- var vm = this._view;
... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | test/specs/element.arc.tests.js | @@ -18,10 +18,6 @@ describe('Arc element tests', function() {
_index: 1
});
- // Make sure we can run these before the view is added
- expect(arc.inRange(2, 2)).toBe(false);
- expect(arc.inLabelRange(2)).toBe(false);
-
// Mock out the view as if the controller put it there
arc._view = {
startAngle... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | test/specs/element.point.tests.js | @@ -20,7 +20,6 @@ describe('Chart.elements.Point', function() {
// Safely handles if these are called before the viewmodel is instantiated
expect(point.inRange(5)).toBe(false);
- expect(point.inLabelRange(5)).toBe(false);
// Attach a view object as if we were the controller
point._view = {
@@ -34,13 +3... | true |
Other | chartjs | Chart.js | 7a2160461df1541993f1ba2936d87d5292dd14be.json | Remove unused Element methods (#6694) | test/specs/element.rectangle.tests.js | @@ -20,7 +20,6 @@ describe('Rectangle element tests', function() {
// Safely handles if these are called before the viewmodel is instantiated
expect(rectangle.inRange(5)).toBe(false);
- expect(rectangle.inLabelRange(5)).toBe(false);
// Attach a view object as if we were the controller
rectangle._view =... | true |
Other | chartjs | Chart.js | f0fb2c65b1ba9b0dbc60acac611daec3ee54b320.json | Remove tension option backwards compatibility (#6692) | docs/getting-started/v3-migration.md | @@ -29,6 +29,7 @@ Chart.js is no longer providing the `Chart.bundle.js` and `Chart.bundle.min.js`.
### Options
+* The dataset option `tension` was renamed to `lineTension`
* `scales.[x/y]Axes.barPercentage` was moved to dataset option `barPercentage`
* `scales.[x/y]Axes.barThickness` was moved to dataset option ... | true |
Other | chartjs | Chart.js | f0fb2c65b1ba9b0dbc60acac611daec3ee54b320.json | Remove tension option backwards compatibility (#6692) | src/controllers/controller.line.js | @@ -82,11 +82,6 @@ module.exports = DatasetController.extend({
// Update Line
if (showLine) {
- // Compatibility: If the properties are defined with only the old name, use those values
- if (config.tension !== undefined && config.lineTension === undefined) {
- config.lineTension = config.tension;
- }
-... | true |
Other | chartjs | Chart.js | 83d447f317cebeb8c2445abfc8b5e17e0187e698.json | Fix doughnut sample (#6690) | src/core/core.controller.js | @@ -449,7 +449,7 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
},
/**
- * Resets the chart back to it's state before the initial animation
+ * Resets the chart back to its state before the initial animation
*/
reset: function() {
this.resetElements();
@@ -460,6 +460,8 @@ helpers.extend(Chart.pro... | false |
Other | chartjs | Chart.js | dd8d267956686cd2237134157e2e1b7bb8b2c244.json | Remove bundled builds (#6680) | docs/developers/README.md | @@ -13,8 +13,8 @@ Latest documentation and samples, including unreleased features, are available a
Latest builds are available for testing at:
+ - https://www.chartjs.org/dist/master/Chart.js
- https://www.chartjs.org/dist/master/Chart.min.js
- - https://www.chartjs.org/dist/master/Chart.bundle.min.js
> Note:... | true |
Other | chartjs | Chart.js | dd8d267956686cd2237134157e2e1b7bb8b2c244.json | Remove bundled builds (#6680) | docs/getting-started/installation.md | @@ -38,21 +38,3 @@ https://www.jsdelivr.com/package/npm/chart.js?path=dist
You can download the latest version of [Chart.js on GitHub](https://github.com/chartjs/Chart.js/releases/latest).
If you download or clone the repository, you must [build](../developers/contributing.md#building-and-testing) Chart.js to gener... | true |
Other | chartjs | Chart.js | dd8d267956686cd2237134157e2e1b7bb8b2c244.json | Remove bundled builds (#6680) | docs/getting-started/v3-migration.md | @@ -2,7 +2,11 @@
Chart.js 3.0 introduces a number of breaking changes. Chart.js 2.0 was released in April 2016. In the years since then, as Chart.js has grown in popularity and feature set, we've learned some lessons about how to better create a charting library. In order to improve performance, offer new features, ... | true |
Other | chartjs | Chart.js | dd8d267956686cd2237134157e2e1b7bb8b2c244.json | Remove bundled builds (#6680) | rollup.config.js | @@ -17,7 +17,7 @@ const banner = `/*!
*/`;
module.exports = [
- // ES6 builds (excluding moment)
+ // ES6 builds
// dist/Chart.esm.min.js
// dist/Chart.esm.js
{
@@ -77,7 +77,7 @@ module.exports = [
'moment'
]
},
- // UMD builds (excluding moment)
+ // UMD builds
// dist/Chart.min.js
// dist/Char... | true |
Other | chartjs | Chart.js | 80587bb68dd7a1b5d6bea2f70b0362378bf27a62.json | Remove unused parameters (#6674) | src/core/core.controller.js | @@ -622,11 +622,10 @@ helpers.extend(Chart.prototype, /** @lends Chart */ {
easing: config.easing || animationOptions.easing,
render: function(chart, animationObject) {
- var easingFunction = helpers.easing.effects[animationObject.easing];
- var currentStep = animationObject.currentStep;
- var s... | false |
Other | chartjs | Chart.js | 6942e9058c06494105b42f4efd18f80b2ab64ac1.json | Hide correct dataset from legend (#6667) | src/plugins/plugin.legend.js | @@ -53,13 +53,13 @@ defaults._set('global', {
var options = chart.options.legend || {};
var usePointStyle = options.labels && options.labels.usePointStyle;
- return chart._getSortedDatasetMetas().map(function(meta, i) {
+ return chart._getSortedDatasetMetas().map(function(meta) {
var style = met... | false |
Other | chartjs | Chart.js | 0a873c0786934964c32b15e90fcb7cdc05a727e2.json | Fix polar area sample (#6665) | samples/charts/polar-area.html | @@ -29,8 +29,8 @@
var chartColors = window.chartColors;
var color = Chart.helpers.color;
var config = {
+ type: 'polarArea',
data: {
- type: 'polarArea',
datasets: [{
data: [
randomScalingFactor(), | false |
Other | chartjs | Chart.js | 5452502b8ced16384d80d3ca70434d10717eb7cd.json | Add pointStyleWidth option for legend (#10412)
* add pointStyleWidth for legend
* add drawPointLegend to keep drawPoint signature | docs/configuration/legend.md | @@ -65,7 +65,8 @@ Namespace: `options.plugins.legend.labels`
| `sort` | `function` | `null` | Sorts legend items. Type is : `sort(a: LegendItem, b: LegendItem, data: ChartData): number;`. Receives 3 parameters, two [Legend Items](#legend-item-interface) and the chart data. The return value of the function is a number ... | true |
Other | chartjs | Chart.js | 5452502b8ced16384d80d3ca70434d10717eb7cd.json | Add pointStyleWidth option for legend (#10412)
* add pointStyleWidth for legend
* add drawPointLegend to keep drawPoint signature | src/helpers/helpers.canvas.js | @@ -127,7 +127,11 @@ export function clearCanvas(canvas, ctx) {
}
export function drawPoint(ctx, options, x, y) {
- let type, xOffset, yOffset, size, cornerRadius;
+ drawPointLegend(ctx, options, x, y, null);
+}
+
+export function drawPointLegend(ctx, options, x, y, w) {
+ let type, xOffset, yOffset, size, corne... | true |
Other | chartjs | Chart.js | 5452502b8ced16384d80d3ca70434d10717eb7cd.json | Add pointStyleWidth option for legend (#10412)
* add pointStyleWidth for legend
* add drawPointLegend to keep drawPoint signature | src/plugins/plugin.legend.js | @@ -1,7 +1,7 @@
import defaults from '../core/core.defaults';
import Element from '../core/core.element';
import layouts from '../core/core.layouts';
-import {addRoundedRectPath, drawPoint, renderText} from '../helpers/helpers.canvas';
+import {addRoundedRectPath, drawPointLegend, renderText} from '../helpers/helper... | true |
Other | chartjs | Chart.js | 5452502b8ced16384d80d3ca70434d10717eb7cd.json | Add pointStyleWidth option for legend (#10412)
* add pointStyleWidth for legend
* add drawPointLegend to keep drawPoint signature | types/helpers/helpers.canvas.d.ts | @@ -18,6 +18,8 @@ export interface DrawPointOptions {
export function drawPoint(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number): void;
+export function drawPointLegend(ctx: CanvasRenderingContext2D, options: DrawPointOptions, x: number, y: number, w: number): void;
+
/**
* Conver... | true |
Other | chartjs | Chart.js | e3b2b5279081b9040fdc493030e2c70ca8f71cc7.json | Fix crash with skipNull and uneven datasets (#10454) | src/controllers/controller.bar.js | @@ -390,41 +390,36 @@ export default class BarController extends DatasetController {
* @private
*/
_getStacks(last, dataIndex) {
- const meta = this._cachedMeta;
- const iScale = meta.iScale;
- const metasets = iScale.getMatchingVisibleMetas(this._type);
+ const {iScale} = this._cachedMeta;
+ co... | true |
Other | chartjs | Chart.js | e3b2b5279081b9040fdc493030e2c70ca8f71cc7.json | Fix crash with skipNull and uneven datasets (#10454) | test/specs/controller.bar.tests.js | @@ -1655,4 +1655,24 @@ describe('Chart.controllers.bar', function() {
expect(ctx.getCalls().filter(x => x.name === 'clip').length).toEqual(0);
});
});
+
+ it('should not crash with skipNull and uneven datasets', function() {
+ function unevenChart() {
+ window.acquireChart({
+ type: 'bar'... | true |
Other | chartjs | Chart.js | 58e736a0b98e021e5ac1d340aa52d63eb3606573.json | Update aspectRatio documentation (#10456) | docs/configuration/responsive.md | @@ -18,7 +18,7 @@ Namespace: `options`
| ---- | ---- | ------- | -----------
| `responsive` | `boolean` | `true` | Resizes the chart canvas when its container does ([important note...](#important-note)).
| `maintainAspectRatio` | `boolean` | `true` | Maintain the original canvas aspect ratio `(width / height)` when ... | false |
Other | chartjs | Chart.js | 0312697f38f88b3930f83e56d5850c4b4ff288c4.json | Add index to legendItem interface (#10436)
* Add index to legendItem interface for doughnut, pie and polarArea charts. Make datasetIndex optional since the before named charts dont include it.
* Remove test to check if datasetIndex has been set in generateLabels function for legend | types/index.esm.d.ts | @@ -2165,7 +2165,12 @@ export interface LegendItem {
/**
* Index of the associated dataset
*/
- datasetIndex: number;
+ datasetIndex?: number;
+
+ /**
+ * Index the associated label in the labels array
+ */
+ index?: number
/**
* Fill style of the legend box | true |
Other | chartjs | Chart.js | 0312697f38f88b3930f83e56d5850c4b4ff288c4.json | Add index to legendItem interface (#10436)
* Add index to legendItem interface for doughnut, pie and polarArea charts. Make datasetIndex optional since the before named charts dont include it.
* Remove test to check if datasetIndex has been set in generateLabels function for legend | types/tests/plugins/defaults.ts | @@ -9,10 +9,3 @@ defaults.plugins.legend.labels.generateLabels = function(chart) {
text: 'test'
}];
};
-
-// @ts-expect-error Type '{ text: string; }[]' is not assignable to type 'LegendItem[]'.
-defaults.plugins.legend.labels.generateLabels = function(chart) {
- return [{
- text: 'test'
- }];
-}; | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | docs/configuration/interactions.md | @@ -7,6 +7,7 @@ Namespace: `options.interaction`, the global interaction configuration is at `Ch
| `mode` | `string` | `'nearest'` | Sets which elements appear in the interaction. See [Interaction Modes](#modes) for details.
| `intersect` | `boolean` | `true` | if true, the interaction mode only applies when the mous... | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | src/core/core.defaults.js | @@ -62,7 +62,8 @@ export class Defaults {
this.indexAxis = 'x';
this.interaction = {
mode: 'nearest',
- intersect: true
+ intersect: true,
+ includeInvisible: false
};
this.maintainAspectRatio = true;
this.onHover = null; | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | src/core/core.interaction.js | @@ -6,7 +6,7 @@ import {_isPointInArea} from '../helpers';
/**
* @typedef { import("./core.controller").default } Chart
* @typedef { import("../../types/index.esm").ChartEvent } ChartEvent
- * @typedef {{axis?: string, intersect?: boolean}} InteractionOptions
+ * @typedef {{axis?: string, intersect?: boolean, incl... | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | src/platform/platform.dom.js | @@ -211,7 +211,7 @@ function createResizeObserver(chart, type, listener) {
const width = entry.contentRect.width;
const height = entry.contentRect.height;
// When its container's display is set to 'none' the callback will be called with a
- // size of (0, 0), which will cause the chart to lost its ori... | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | test/specs/core.interaction.tests.js | @@ -870,5 +870,46 @@ describe('Core.Interaction', function() {
const elements = Chart.Interaction.modes.point(chart, evt, {intersect: true}).map(item => item.element);
expect(elements).not.toContain(firstElement);
});
+
+ it ('out-of-range datapoints are shown in tooltip if included', function() {... | true |
Other | chartjs | Chart.js | ebcaff15c2bd8aa74b1d8c1d082aee783f700f1b.json | Add option to include invisible points (#10362)
* Add option to include invisible points
* Minor fixes
* Add doc for newly added option
* Fix typo
* Add test for newly added option
* Improve description of the new option
* Update docs/configuration/interactions.md
Co-authored-by: Jacco van den Ber... | types/index.esm.d.ts | @@ -701,6 +701,7 @@ export const defaults: Defaults;
export interface InteractionOptions {
axis?: string;
intersect?: boolean;
+ includeInvisible?: boolean;
}
export interface InteractionItem {
@@ -1434,6 +1435,12 @@ export interface CoreInteractionOptions {
* Defines which directions are used in calcul... | true |
Other | chartjs | Chart.js | 4183b7f04a8f5b1e8336aaa8b93f260ffd66a042.json | Add links to docs in all the samples (#10308) | docs/samples/advanced/data-decimation.md | @@ -111,3 +111,8 @@ module.exports = {
config: config,
};
```
+## Docs
+* [Data Decimation](../../configuration/decimation.html)
+* [Line](../../charts/line.html)
+* [Time Scale](../../axes/cartesian/time.html)
+ | true |
Other | chartjs | Chart.js | 4183b7f04a8f5b1e8336aaa8b93f260ffd66a042.json | Add links to docs in all the samples (#10308) | docs/samples/advanced/derived-axis-type.md | @@ -48,3 +48,8 @@ module.exports = {
## Log2 axis implementation
<<< @/docs/scripts/log2.js
+
+## Docs
+* [Data structures (`labels`)](../../general/data-structures.html)
+* [Line](../../charts/line.html)
+* [New Axes](../../developers/axes.html) | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.