Skip to content

Commit a92dd7b

Browse files
authored
Release v2.9.1 (#6618)
Release v2.9.1
1 parent 26b9d1f commit a92dd7b

22 files changed

+120
-45
lines changed

docs/general/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ These sections describe general configuration options that can apply elsewhere i
88
* [Options](./options.md) scriptable and indexable options syntax.
99
* [Colors](./colors.md) defines acceptable color values.
1010
* [Font](./fonts.md) defines various font options.
11+
* [Performance](./performance.md) gives tips for performance-sensitive applications.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "chart.js",
33
"homepage": "https://www.chartjs.org",
44
"description": "Simple HTML5 charts using the canvas element.",
5-
"version": "2.9.0",
5+
"version": "2.9.1",
66
"license": "MIT",
77
"jsdelivr": "dist/Chart.min.js",
88
"unpkg": "dist/Chart.min.js",

src/controllers/controller.horizontalBar.js

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ defaults._set('horizontalBar', {
1818
yAxes: [{
1919
type: 'category',
2020
position: 'left',
21-
categoryPercentage: 0.8,
22-
barPercentage: 0.9,
2321
offset: true,
2422
gridLines: {
2523
offsetGridLines: true
@@ -39,6 +37,15 @@ defaults._set('horizontalBar', {
3937
}
4038
});
4139

40+
defaults._set('global', {
41+
datasets: {
42+
horizontalBar: {
43+
categoryPercentage: 0.8,
44+
barPercentage: 0.9
45+
}
46+
}
47+
});
48+
4249
module.exports = BarController.extend({
4350
/**
4451
* @private
@@ -54,4 +61,3 @@ module.exports = BarController.extend({
5461
return this.getMeta().yAxisID;
5562
}
5663
});
57-

src/controllers/controller.line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,9 @@ module.exports = DatasetController.extend({
209209
if (rightValue < 0) {
210210
return yScale.getPixelForValue(sumNeg + rightValue);
211211
}
212+
return yScale.getPixelForValue(sumPos + rightValue);
212213
}
213-
return yScale.getPixelForValue(sumPos + rightValue);
214+
return yScale.getPixelForValue(value);
214215
},
215216

216217
updateBezierControlPoints: function() {

src/core/core.scale.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ var Scale = Element.extend({
929929

930930
getDecimalForPixel: function(pixel) {
931931
var decimal = (pixel - this._startPixel) / this._length;
932-
return Math.min(1, Math.max(0, this._reversePixels ? 1 - decimal : decimal));
932+
return this._reversePixels ? 1 - decimal : decimal;
933933
},
934934

935935
/**

test/fixtures/controller.bar/bar-thickness-absolute.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2017", "2018", "2019", "2024", "2025"],
66
"datasets": [{
77
"backgroundColor": "rgba(255, 99, 132, 0.5)",
8+
"barPercentage": 1,
9+
"categoryPercentage": 1,
10+
"barThickness": 128,
811
"data": [1, null, 3, 4, 5]
912
}]
1013
},
@@ -17,9 +20,6 @@
1720
"type": "time",
1821
"offset": true,
1922
"display": false,
20-
"barPercentage": 1,
21-
"categoryPercentage": 1,
22-
"barThickness": 128,
2323
"time": {
2424
"parser": "YYYY"
2525
},

test/fixtures/controller.bar/bar-thickness-flex-offset.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2017", "2018", "2020", "2024", "2038"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barPercentage": 1,
9+
"categoryPercentage": 1,
10+
"barThickness": "flex",
811
"data": [1, null, 3, 4, 5]
912
}]
1013
},
@@ -17,9 +20,6 @@
1720
"type": "time",
1821
"offset": true,
1922
"display": false,
20-
"barPercentage": 1,
21-
"categoryPercentage": 1,
22-
"barThickness": "flex",
2323
"time": {
2424
"parser": "YYYY"
2525
},

test/fixtures/controller.bar/bar-thickness-flex-single-reverse.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barThickness": "flex",
9+
"barPercentage": 1,
10+
"categoryPercentage": 1,
811
"data": [1]
912
}]
1013
},
@@ -16,9 +19,6 @@
1619
"xAxes": [{
1720
"type": "time",
1821
"display": false,
19-
"barThickness": "flex",
20-
"barPercentage": 1,
21-
"categoryPercentage": 1,
2222
"time": {
2323
"parser": "YYYY"
2424
},

test/fixtures/controller.bar/bar-thickness-flex-single.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barThickness": "flex",
9+
"barPercentage": 1,
10+
"categoryPercentage": 1,
811
"data": [1]
912
}]
1013
},
@@ -16,9 +19,6 @@
1619
"xAxes": [{
1720
"type": "time",
1821
"display": false,
19-
"barThickness": "flex",
20-
"barPercentage": 1,
21-
"categoryPercentage": 1,
2222
"time": {
2323
"parser": "YYYY"
2424
},

test/fixtures/controller.bar/bar-thickness-flex.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2017", "2018", "2020", "2024", "2038"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barPercentage": 1,
9+
"categoryPercentage": 1,
10+
"barThickness": "flex",
811
"data": [1, null, 3, 4, 5]
912
}]
1013
},
@@ -16,9 +19,6 @@
1619
"xAxes": [{
1720
"type": "time",
1821
"display": false,
19-
"barPercentage": 1,
20-
"categoryPercentage": 1,
21-
"barThickness": "flex",
2222
"time": {
2323
"parser": "YYYY"
2424
},

test/fixtures/controller.bar/bar-thickness-max.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barPercentage": 1,
9+
"categoryPercentage": 1,
10+
"maxBarThickness": 8,
811
"data": [1, null, 3, 4, 5]
912
}]
1013
},
@@ -16,9 +19,6 @@
1619
"xAxes": [{
1720
"type": "time",
1821
"display": false,
19-
"barPercentage": 1,
20-
"categoryPercentage": 1,
21-
"maxBarThickness": 8,
2222
"time": {
2323
"parser": "YYYY"
2424
},

test/fixtures/controller.bar/bar-thickness-min-interval.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
77
"backgroundColor": "#FF6384",
8+
"barPercentage": 1,
9+
"categoryPercentage": 1,
810
"data": [1, null, 3, 4, 5]
911
}]
1012
},
@@ -16,8 +18,6 @@
1618
"xAxes": [{
1719
"type": "time",
1820
"display": false,
19-
"barPercentage": 1,
20-
"categoryPercentage": 1,
2121
"time": {
2222
"parser": "YYYY"
2323
},

test/fixtures/controller.bar/bar-thickness-multiple.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
"responsive": false,
1919
"legend": false,
2020
"title": false,
21+
"datasets": {
22+
"bar": {
23+
"barPercentage": 1,
24+
"categoryPercentage": 1
25+
}
26+
},
2127
"scales": {
2228
"xAxes": [{
2329
"type": "time",
2430
"display": false,
25-
"barPercentage": 1,
26-
"categoryPercentage": 1,
2731
"time": {
2832
"parser": "YYYY"
2933
},

test/fixtures/controller.bar/bar-thickness-no-overlap.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
"responsive": false,
1919
"legend": false,
2020
"title": false,
21+
"datasets": {
22+
"bar": {
23+
"barPercentage": 1,
24+
"categoryPercentage": 1
25+
}
26+
},
2127
"scales": {
2228
"xAxes": [{
2329
"type": "time",
2430
"display": false,
25-
"barPercentage": 1,
26-
"categoryPercentage": 1,
2731
"time": {
2832
"parser": "YYYY-MM"
2933
},

test/fixtures/controller.bar/bar-thickness-offset.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
"responsive": false,
1919
"legend": false,
2020
"title": false,
21+
"datasets": {
22+
"bar": {
23+
"barPercentage": 1,
24+
"categoryPercentage": 1
25+
}
26+
},
2127
"scales": {
2228
"xAxes": [{
2329
"type": "time",
2430
"offset": true,
2531
"display": false,
26-
"barPercentage": 1,
27-
"categoryPercentage": 1,
2832
"time": {
2933
"parser": "YYYY"
3034
},

test/fixtures/controller.bar/bar-thickness-reverse.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,16 @@
1818
"responsive": false,
1919
"legend": false,
2020
"title": false,
21+
"datasets": {
22+
"bar": {
23+
"barPercentage": 1,
24+
"categoryPercentage": 1
25+
}
26+
},
2127
"scales": {
2228
"xAxes": [{
2329
"type": "time",
2430
"display": false,
25-
"barPercentage": 1,
26-
"categoryPercentage": 1,
2731
"time": {
2832
"parser": "YYYY"
2933
},

test/fixtures/controller.bar/bar-thickness-single-xy.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"data": {
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
7+
"barPercentage": 1,
8+
"categoryPercentage": 1,
79
"backgroundColor": "#FF6384",
810
"data": [{"x": "2022", "y": 42}]
911
}]
@@ -16,8 +18,6 @@
1618
"xAxes": [{
1719
"type": "time",
1820
"display": false,
19-
"barPercentage": 1,
20-
"categoryPercentage": 1,
2121
"time": {
2222
"parser": "YYYY"
2323
},

test/fixtures/controller.bar/bar-thickness-single.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
"data": {
55
"labels": ["2016", "2018", "2020", "2024", "2030"],
66
"datasets": [{
7+
"barPercentage": 1,
8+
"categoryPercentage": 1,
79
"backgroundColor": "#FF6384",
810
"data": [1]
911
}]
@@ -16,8 +18,6 @@
1618
"xAxes": [{
1719
"type": "time",
1820
"display": false,
19-
"barPercentage": 1,
20-
"categoryPercentage": 1,
2121
"time": {
2222
"parser": "YYYY"
2323
},

test/fixtures/controller.bar/bar-thickness-stacked.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,17 @@
1818
"responsive": false,
1919
"legend": false,
2020
"title": false,
21+
"datasets": {
22+
"bar": {
23+
"barPercentage": 1,
24+
"categoryPercentage": 1
25+
}
26+
},
2127
"scales": {
2228
"xAxes": [{
2329
"type": "time",
2430
"stacked": true,
2531
"display": false,
26-
"barPercentage": 1,
27-
"categoryPercentage": 1,
2832
"time": {
2933
"parser": "YYYY"
3034
},
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"config": {
3+
"type": "line",
4+
"data": {
5+
"xLabels": ["January", "February", "March", "April", "May", "June", "July"],
6+
"yLabels": ["", "Request Added", "Request Viewed", "Request Accepted", "Request Solved", "Solving Confirmed"],
7+
"datasets": [{
8+
"label": "My First dataset",
9+
"data": ["", "Request Added", "Request Added", "Request Added", "Request Viewed", "Request Viewed", "Request Viewed"],
10+
"fill": false,
11+
"borderColor": "red",
12+
"backgroundColor": "red"
13+
}]
14+
},
15+
"options": {
16+
"responsive": false,
17+
"legend": false,
18+
"title": false,
19+
"scales": {
20+
"xAxes": [{"display": false}],
21+
"yAxes": [{
22+
"type": "category",
23+
"display": false
24+
}]
25+
}
26+
}
27+
},
28+
"options": {
29+
"canvas": {
30+
"height": 256,
31+
"width": 512
32+
}
33+
}
34+
}
3.62 KB
Loading

0 commit comments

Comments
 (0)