Skip to content

Commit

Permalink
Release v2.9.1 (#6618)
Browse files Browse the repository at this point in the history
Release v2.9.1
  • Loading branch information
etimberg authored Oct 27, 2019
1 parent 26b9d1f commit a92dd7b
Show file tree
Hide file tree
Showing 22 changed files with 120 additions and 45 deletions.
1 change: 1 addition & 0 deletions docs/general/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ These sections describe general configuration options that can apply elsewhere i
* [Options](./options.md) scriptable and indexable options syntax.
* [Colors](./colors.md) defines acceptable color values.
* [Font](./fonts.md) defines various font options.
* [Performance](./performance.md) gives tips for performance-sensitive applications.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "chart.js",
"homepage": "https://www.chartjs.org",
"description": "Simple HTML5 charts using the canvas element.",
"version": "2.9.0",
"version": "2.9.1",
"license": "MIT",
"jsdelivr": "dist/Chart.min.js",
"unpkg": "dist/Chart.min.js",
Expand Down
12 changes: 9 additions & 3 deletions src/controllers/controller.horizontalBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ defaults._set('horizontalBar', {
yAxes: [{
type: 'category',
position: 'left',
categoryPercentage: 0.8,
barPercentage: 0.9,
offset: true,
gridLines: {
offsetGridLines: true
Expand All @@ -39,6 +37,15 @@ defaults._set('horizontalBar', {
}
});

defaults._set('global', {
datasets: {
horizontalBar: {
categoryPercentage: 0.8,
barPercentage: 0.9
}
}
});

module.exports = BarController.extend({
/**
* @private
Expand All @@ -54,4 +61,3 @@ module.exports = BarController.extend({
return this.getMeta().yAxisID;
}
});

3 changes: 2 additions & 1 deletion src/controllers/controller.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,9 @@ module.exports = DatasetController.extend({
if (rightValue < 0) {
return yScale.getPixelForValue(sumNeg + rightValue);
}
return yScale.getPixelForValue(sumPos + rightValue);
}
return yScale.getPixelForValue(sumPos + rightValue);
return yScale.getPixelForValue(value);
},

updateBezierControlPoints: function() {
Expand Down
2 changes: 1 addition & 1 deletion src/core/core.scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ var Scale = Element.extend({

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

/**
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/controller.bar/bar-thickness-absolute.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2017", "2018", "2019", "2024", "2025"],
"datasets": [{
"backgroundColor": "rgba(255, 99, 132, 0.5)",
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": 128,
"data": [1, null, 3, 4, 5]
}]
},
Expand All @@ -17,9 +20,6 @@
"type": "time",
"offset": true,
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": 128,
"time": {
"parser": "YYYY"
},
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/controller.bar/bar-thickness-flex-offset.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2017", "2018", "2020", "2024", "2038"],
"datasets": [{
"backgroundColor": "#FF6384",
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": "flex",
"data": [1, null, 3, 4, 5]
}]
},
Expand All @@ -17,9 +20,6 @@
"type": "time",
"offset": true,
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": "flex",
"time": {
"parser": "YYYY"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
"barThickness": "flex",
"barPercentage": 1,
"categoryPercentage": 1,
"data": [1]
}]
},
Expand All @@ -16,9 +19,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barThickness": "flex",
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/controller.bar/bar-thickness-flex-single.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
"barThickness": "flex",
"barPercentage": 1,
"categoryPercentage": 1,
"data": [1]
}]
},
Expand All @@ -16,9 +19,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barThickness": "flex",
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/controller.bar/bar-thickness-flex.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2017", "2018", "2020", "2024", "2038"],
"datasets": [{
"backgroundColor": "#FF6384",
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": "flex",
"data": [1, null, 3, 4, 5]
}]
},
Expand All @@ -16,9 +19,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"barThickness": "flex",
"time": {
"parser": "YYYY"
},
Expand Down
6 changes: 3 additions & 3 deletions test/fixtures/controller.bar/bar-thickness-max.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
"barPercentage": 1,
"categoryPercentage": 1,
"maxBarThickness": 8,
"data": [1, null, 3, 4, 5]
}]
},
Expand All @@ -16,9 +19,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"maxBarThickness": 8,
"time": {
"parser": "YYYY"
},
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-min-interval.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
"barPercentage": 1,
"categoryPercentage": 1,
"data": [1, null, 3, 4, 5]
}]
},
Expand All @@ -16,8 +18,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
8 changes: 6 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-multiple.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"responsive": false,
"legend": false,
"title": false,
"datasets": {
"bar": {
"barPercentage": 1,
"categoryPercentage": 1
}
},
"scales": {
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
8 changes: 6 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-no-overlap.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"responsive": false,
"legend": false,
"title": false,
"datasets": {
"bar": {
"barPercentage": 1,
"categoryPercentage": 1
}
},
"scales": {
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY-MM"
},
Expand Down
8 changes: 6 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-offset.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
"responsive": false,
"legend": false,
"title": false,
"datasets": {
"bar": {
"barPercentage": 1,
"categoryPercentage": 1
}
},
"scales": {
"xAxes": [{
"type": "time",
"offset": true,
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
8 changes: 6 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-reverse.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"responsive": false,
"legend": false,
"title": false,
"datasets": {
"bar": {
"barPercentage": 1,
"categoryPercentage": 1
}
},
"scales": {
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-single-xy.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"data": {
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"barPercentage": 1,
"categoryPercentage": 1,
"backgroundColor": "#FF6384",
"data": [{"x": "2022", "y": 42}]
}]
Expand All @@ -16,8 +18,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
4 changes: 2 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-single.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
"data": {
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"barPercentage": 1,
"categoryPercentage": 1,
"backgroundColor": "#FF6384",
"data": [1]
}]
Expand All @@ -16,8 +18,6 @@
"xAxes": [{
"type": "time",
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
8 changes: 6 additions & 2 deletions test/fixtures/controller.bar/bar-thickness-stacked.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,17 @@
"responsive": false,
"legend": false,
"title": false,
"datasets": {
"bar": {
"barPercentage": 1,
"categoryPercentage": 1
}
},
"scales": {
"xAxes": [{
"type": "time",
"stacked": true,
"display": false,
"barPercentage": 1,
"categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
Expand Down
34 changes: 34 additions & 0 deletions test/fixtures/controller.line/non-numeric-y.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"config": {
"type": "line",
"data": {
"xLabels": ["January", "February", "March", "April", "May", "June", "July"],
"yLabels": ["", "Request Added", "Request Viewed", "Request Accepted", "Request Solved", "Solving Confirmed"],
"datasets": [{
"label": "My First dataset",
"data": ["", "Request Added", "Request Added", "Request Added", "Request Viewed", "Request Viewed", "Request Viewed"],
"fill": false,
"borderColor": "red",
"backgroundColor": "red"
}]
},
"options": {
"responsive": false,
"legend": false,
"title": false,
"scales": {
"xAxes": [{"display": false}],
"yAxes": [{
"type": "category",
"display": false
}]
}
}
},
"options": {
"canvas": {
"height": 256,
"width": 512
}
}
}
Binary file added test/fixtures/controller.line/non-numeric-y.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit a92dd7b

Please sign in to comment.