Fixed growing of doughnut charts on scrolling.
Charts were growing on many pages due to spaces in id. Fixes #1903
This commit is contained in:
parent
3afe905448
commit
0091d87dc9
1 changed files with 2 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
.text-center
|
.text-center
|
||||||
%h4 #{title}
|
%h4 #{title}
|
||||||
%canvas.doughnut_chart{ id: "dough_#{title}", 'data-chart' => data.to_json }
|
%canvas.doughnut_chart{ id: "dough_#{title.parameterize.underscore}", 'data-chart' => data.to_json }
|
||||||
- if data
|
- if data
|
||||||
- data.each do |key, value|
|
- data.each do |key, value|
|
||||||
%span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']}
|
%span{ 'style' => "border-bottom: 3px solid #{value['color']}" } #{key}: #{value['value']}
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
:javascript
|
:javascript
|
||||||
$(document).ready( function(){
|
$(document).ready( function(){
|
||||||
|
|
||||||
var d = $("#dough_#{title}");
|
var d = $("#dough_#{title.parameterize.underscore}");
|
||||||
var dt = d.get(0).getContext('2d');
|
var dt = d.get(0).getContext('2d');
|
||||||
|
|
||||||
$(window).resize( respondCanvas );
|
$(window).resize( respondCanvas );
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue