Skip to content

Commit

Permalink
Add second parameter to colorFunction callback.
Browse files Browse the repository at this point in the history
  • Loading branch information
fanthos committed Feb 5, 2018
1 parent dcfcbe2 commit f7e01fd
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "chartjs-chart-timeline",
"version": "0.1.3",
"description": "timeline chart type for chart.js",
"main": "timeline.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/fanthos/chartjs-chart-timeline.git"
},
"keywords": [
"chartjs",
"chart",
"timeline",
"plugin"
],
"author": "fanthos",
"license": "BSD-2-Clause",
"bugs": {
"url": "https://github.com/fanthos/chartjs-chart-timeline/issues"
},
"homepage": "https://github.com/fanthos/chartjs-chart-timeline#readme"
}
2 changes: 1 addition & 1 deletion timeline.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ Chart.controllers.timeline = Chart.controllers.bar.extend({
var y = yScale.getPixelForValue(data, datasetIndex, datasetIndex);
var width = end - x;
var height = me.calculateBarHeight(ruler);
var color = me.chart.options.colorFunction(text);
var color = me.chart.options.colorFunction(text, data);
var showText = me.chart.options.showText;

var font = me.chart.options.elements.font;
Expand Down

0 comments on commit f7e01fd

Please sign in to comment.