Merge pull request #12113 from pratu16x7/leaderboard

Add Leaderboard to desktop
This commit is contained in:
Prateeksha Singh 2017-12-20 11:39:05 +05:30 committed by GitHub
commit 9a57049faa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 12 deletions

View File

@ -134,6 +134,14 @@ def get_data():
"link": "pos", "link": "pos",
"label": _("POS") "label": _("POS")
}, },
{
"module_name": "Leaderboard",
"color": "#589494",
"icon": "octicon octicon-graph",
"type": "page",
"link": "leaderboard",
"label": _("Leaderboard")
},
{ {
"module_name": "Projects", "module_name": "Projects",
"color": "#8e44ad", "color": "#8e44ad",

View File

@ -132,21 +132,21 @@ frappe.Leaderboard = Class.extend({
me.$graph_area.show().empty(); me.$graph_area.show().empty();
let args = { let args = {
parent: me.$graph_area, parent: '.leaderboard-graph',
y: [ data: {
{ datasets: [
color: 'light-green', {
values: graph_items.map(d=>d.value), values: graph_items.map(d=>d.value)
formatted: graph_items.map(d=>d[me.options.selected_filter_item]) }
} ],
], labels: graph_items.map(d=>d.name)
x: {
values: graph_items.map(d=>d.name)
}, },
mode: 'bar', colors: ['light-green'],
format_tooltip_x: d=>d[me.options.selected_filter_item],
type: 'bar',
height: 140 height: 140
}; };
new frappe.ui.Graph(args); new Chart(args);
notify(me, r, $container); notify(me, r, $container);
} }