Skip to content

Commit

Permalink
fix for #12, added an error message if height/width is not set.
Browse files Browse the repository at this point in the history
  • Loading branch information
chinmaymk committed Jan 23, 2014
1 parent 9c1559c commit 13f3f68
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions dist/angular-charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ angular.module('angularCharts').directive('acChart', [
};
var totalWidth = element.width(), totalHeight = element.height();
var data, series, points, height, width, chartContainer, legendContainer, chartType, isAnimate = true, defaultColors = config.colors;
if (totalHeight === 0 || totalWidth === 0) {
throw new Error('Please set height and width for the chart element');
}
function init() {
prepareData();
setHeightWidth();
Expand Down
Loading

0 comments on commit 13f3f68

Please sign in to comment.