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
eaeea54e
Commit
eaeea54e
authored
Oct 05, 2018
by
Mikaël Salson
Browse files
stats_decorator: Better see small graphs
parent
66f976e5
Pipeline
#42594
failed with stages
in 9 minutes and 45 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
server/web2py/applications/vidjil/models/stats_decorator.py
View file @
eaeea54e
...
...
@@ -48,7 +48,9 @@ class LabeledBarChartDecorator(BarChartDecorator):
def
decorate
(
self
,
data
):
bars
=
[]
for
t
in
data
:
style
=
"height: %f%%; width: %f%%"
%
(
t
[
1
],
(
1.0
/
len
(
data
))
*
100
)
percentage_per_item
=
(
1.0
/
len
(
data
))
*
100
# We want larger bars to better see them. However we may not want that with wide labeled bar charts
style
=
"height: %f%%; width: %f%%; margin-right: -%f%"
%
(
t
[
1
],
percentage_per_item
*
2
,
percentage_per_item
)
if
t
[
1
]:
style
+=
";min-height: 1px"
bar_span
=
SPAN
(
_style
=
style
,
_title
=
"%s"
%
t
[
0
],
_class
=
"bar"
)
...
...
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