* [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.
"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",
yAxes: [{
type: 'category',
position: 'left',
- categoryPercentage: 0.8,
- barPercentage: 0.9,
offset: true,
gridLines: {
offsetGridLines: true
}
});
+defaults._set('global', {
+ datasets: {
+ horizontalBar: {
+ categoryPercentage: 0.8,
+ barPercentage: 0.9
+ }
+ }
+});
+
module.exports = BarController.extend({
/**
* @private
return this.getMeta().yAxisID;
}
});
-
if (rightValue < 0) {
return yScale.getPixelForValue(sumNeg + rightValue);
}
+ return yScale.getPixelForValue(sumPos + rightValue);
}
- return yScale.getPixelForValue(sumPos + rightValue);
+ return yScale.getPixelForValue(value);
},
updateBezierControlPoints: function() {
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;
},
/**
"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]
}]
},
"type": "time",
"offset": true,
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
- "barThickness": 128,
"time": {
"parser": "YYYY"
},
"labels": ["2017", "2018", "2020", "2024", "2038"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
+ "barThickness": "flex",
"data": [1, null, 3, 4, 5]
}]
},
"type": "time",
"offset": true,
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
- "barThickness": "flex",
"time": {
"parser": "YYYY"
},
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barThickness": "flex",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
"data": [1]
}]
},
"xAxes": [{
"type": "time",
"display": false,
- "barThickness": "flex",
- "barPercentage": 1,
- "categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barThickness": "flex",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
"data": [1]
}]
},
"xAxes": [{
"type": "time",
"display": false,
- "barThickness": "flex",
- "barPercentage": 1,
- "categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
"labels": ["2017", "2018", "2020", "2024", "2038"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
+ "barThickness": "flex",
"data": [1, null, 3, 4, 5]
}]
},
"xAxes": [{
"type": "time",
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
- "barThickness": "flex",
"time": {
"parser": "YYYY"
},
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
+ "maxBarThickness": 8,
"data": [1, null, 3, 4, 5]
}]
},
"xAxes": [{
"type": "time",
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
- "maxBarThickness": 8,
"time": {
"parser": "YYYY"
},
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
"backgroundColor": "#FF6384",
+ "barPercentage": 1,
+ "categoryPercentage": 1,
"data": [1, null, 3, 4, 5]
}]
},
"xAxes": [{
"type": "time",
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
"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"
},
"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"
},
"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"
},
"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"
},
"data": {
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
+ "barPercentage": 1,
+ "categoryPercentage": 1,
"backgroundColor": "#FF6384",
"data": [{"x": "2022", "y": 42}]
}]
"xAxes": [{
"type": "time",
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
"data": {
"labels": ["2016", "2018", "2020", "2024", "2030"],
"datasets": [{
+ "barPercentage": 1,
+ "categoryPercentage": 1,
"backgroundColor": "#FF6384",
"data": [1]
}]
"xAxes": [{
"type": "time",
"display": false,
- "barPercentage": 1,
- "categoryPercentage": 1,
"time": {
"parser": "YYYY"
},
"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"
},
--- /dev/null
+{
+ "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
+ }
+ }
+}
options: {
legend: false,
title: false,
+ datasets: {
+ bar: {
+ barPercentage: 1,
+ }
+ },
scales: {
xAxes: [{
type: 'category',
display: false,
stacked: true,
- barPercentage: 1,
}],
yAxes: [{
type: 'logarithmic',
options: {
legend: false,
title: false,
+ datasets: {
+ bar: {
+ barPercentage: 1,
+ }
+ },
scales: {
xAxes: [{
type: 'category',
display: false,
stacked: true,
- barPercentage: 1,
}],
yAxes: [{
type: 'logarithmic',
var meta = chart.getDatasetMeta(0);
var yScale = chart.scales[meta.yAxisID];
- var categoryPercentage = yScale.options.categoryPercentage;
- var barPercentage = yScale.options.barPercentage;
+ var config = meta.controller._config;
+ var categoryPercentage = config.categoryPercentage;
+ var barPercentage = config.barPercentage;
var stacked = yScale.options.stacked;
var totalBarHeight = 0;
options: {
legend: false,
title: false,
+ datasets: {
+ bar: {
+ barThickness: barThickness
+ }
+ },
scales: {
xAxes: [{
id: 'x',
type: 'category',
- barThickness: barThickness
}],
yAxes: [{
type: 'linear',