Skip to content

Commit

Permalink
Use width and height for chart
Browse files Browse the repository at this point in the history
  • Loading branch information
klikstermkd authored Dec 22, 2016
1 parent a3fda0c commit 691c4c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ckanext/c3charts/fanstatic/charts.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,16 @@ this.ckan.views.c3charts = this.ckan.views.c3charts || {};
data = remap_data;
key_fields = remap_key_fields;
}

var chartContainer = $(elementId).parent();
var width = chartContainer.attr('data-graph_width');
var height = chartContainer.attr('data-graph_height');

return {
size: {
width: Number(width),
height: Number(height)
},
bindto: elementId,
data: {
json: data,
Expand Down Expand Up @@ -309,4 +317,4 @@ this.ckan.views.c3charts = this.ckan.views.c3charts || {};
return query;
}

})(this.ckan.views.c3charts, this.jQuery, this._);
})(this.ckan.views.c3charts, this.jQuery, this._);

0 comments on commit 691c4c6

Please sign in to comment.