Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
vidjil
vidjil
Commits
7f225421
Commit
7f225421
authored
Sep 14, 2018
by
Ryan Herbert
Browse files
stats_decorator.py use floats for barchart
parent
e966f4c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/models/stats_decorator.py
View file @
7f225421
...
...
@@ -36,7 +36,7 @@ class BarChartDecorator(StatDecorator):
def
decorate
(
self
,
data
):
bars
=
[]
for
val
in
data
:
bar_span
=
SPAN
(
_style
=
"height: %
d
%%; width: %
d
%%"
%
(
val
,
(
1.0
/
len
(
data
))
*
100
),
_title
=
"%
d
%%"
%
val
,
_class
=
"bar"
)
bar_span
=
SPAN
(
_style
=
"height: %
f
%%; width: %
f
%%"
%
(
val
,
(
1.0
/
len
(
data
))
*
100
),
_title
=
"%
f
%%"
%
val
,
_class
=
"bar"
)
bars
.
append
(
bar_span
)
return
DIV
(
*
bars
,
_class
=
"bar_chart"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment