Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
converse.js
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
converse.js
Commits
01edcb81
Commit
01edcb81
authored
Feb 15, 2013
by
Michal Čihař
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve look of activity chart
- No decimal point for maximum
parent
1ce80769
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
weblate/trans/charts.py
weblate/trans/charts.py
+8
-5
No files found.
weblate/trans/charts.py
View file @
01edcb81
...
...
@@ -32,7 +32,7 @@ import cairo
import
pycha.bar
def
render_activity
(
ticks
,
line
):
def
render_activity
(
ticks
,
line
,
maximum
):
'''
Helper for rendering activity charts.
'''
...
...
@@ -52,7 +52,7 @@ def render_activity(ticks, line):
'ticks'
:
ticks
,
},
'y'
:
{
'tick
Count'
:
1
,
'tick
s'
:
[{
'v'
:
0
,
'label'
:
0
},
{
'v'
:
maximum
,
'label'
:
maximum
}]
,
}
},
'background'
:
{
...
...
@@ -139,10 +139,12 @@ def monthly_activity(request, project=None, subproject=None, lang=None):
# Preprocess data for chart
line
=
[(
i
,
l
[
1
])
for
i
,
l
in
enumerate
(
changes_counts
)]
ticks
=
[
dict
(
v
=
i
,
label
=
l
[
0
].
day
)
for
i
,
l
in
enumerate
(
changes_counts
)]
maximum
=
max
([
l
[
1
]
for
l
in
changes_counts
])
ticks
=
[{
'v'
:
i
,
'label'
:
l
[
0
].
day
}
for
i
,
l
in
enumerate
(
changes_counts
)]
# Render chart
return
render_activity
(
ticks
,
line
)
return
render_activity
(
ticks
,
line
,
maximum
)
def
yearly_activity
(
request
,
project
=
None
,
subproject
=
None
,
lang
=
None
):
...
...
@@ -166,11 +168,12 @@ def yearly_activity(request, project=None, subproject=None, lang=None):
# Preprocess data for chart
line
=
[(
i
,
l
[
1
])
for
i
,
l
in
enumerate
(
changes_counts
)]
maximum
=
max
([
l
[
1
]
for
l
in
changes_counts
])
ticks
=
[{
'v'
:
i
,
'label'
:
l
[
0
].
isocalendar
()[
1
]}
for
i
,
l
in
enumerate
(
changes_counts
)]
# Render chart
return
render_activity
(
ticks
,
line
)
return
render_activity
(
ticks
,
line
,
maximum
)
def
view_activity
(
request
,
project
=
None
,
subproject
=
None
,
lang
=
None
):
...
...
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