Skip to content

Commit

Permalink
0.8.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jtblin committed Mar 12, 2016
1 parent 171d8c9 commit 523332e
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-chart.js",
"version": "0.8.8",
"version": "0.8.9",
"main": [
"./dist/angular-chart.js",
"./dist/angular-chart.css"
Expand Down
11 changes: 8 additions & 3 deletions dist/angular-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,11 @@
}
if (! scope.data || ! scope.data.length) return;
scope.getColour = typeof scope.getColour === 'function' ? scope.getColour : getRandomColour;
scope.colours = getColours(type, scope);
var colours = getColours(type, scope);
var cvs = elem[0], ctx = cvs.getContext('2d');
var data = Array.isArray(scope.data[0]) ?
getDataSets(scope.labels, scope.data, scope.series || [], scope.colours) :
getData(scope.labels, scope.data, scope.colours);
getDataSets(scope.labels, scope.data, scope.series || [], colours) :
getData(scope.labels, scope.data, colours);
var options = angular.extend({}, ChartJs.getOptions(type), scope.options);
chart = new ChartJs.Chart(ctx)[type](data, options);
scope.$emit('create', chart);
Expand Down Expand Up @@ -245,13 +245,18 @@
}

function getColours (type, scope) {
var notEnoughColours = false;
var colours = angular.copy(scope.colours ||
ChartJs.getOptions(type).colours ||
Chart.defaults.global.colours
);
while (colours.length < scope.data.length) {
colours.push(scope.getColour());
notEnoughColours = true;
}
// mutate colours in this case as we don't want
// the colours to change on each refresh
if (notEnoughColours) scope.colours = colours;
return colours.map(convertColour);
}

Expand Down
Binary file modified dist/angular-chart.js.tar.gz
Binary file not shown.
2 changes: 1 addition & 1 deletion dist/angular-chart.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-chart.min.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-chart.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/angular-chart.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/charts.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ <h1>
<p>
<a class="btn btn-default btn-lg" href="https://github.com/jtblin/angular-chart"><i class="icon-github"></i>Code on Github</a>
<a class="btn btn-success btn-lg" href="../dist/angular-chart.js.tar.gz" download="angular-chart.js.tar.gz">
<i class="fa fa-download"></i> Download <small>(0.8.8)</small>
<i class="fa fa-download"></i> Download <small>(0.8.9)</small>
</a>
</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-chart.js",
"version": "0.8.8",
"version": "0.8.9",
"description": "An angular.js wrapper for Chart.js",
"main": "dist/angular-chart.js",
"directories": {
Expand Down
2 changes: 1 addition & 1 deletion test/fixtures/coverage.js

Large diffs are not rendered by default.

0 comments on commit 523332e

Please sign in to comment.