Merge pull request #12113 from pratu16x7/leaderboard
Add Leaderboard to desktop
This commit is contained in:
commit
9a57049faa
@ -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",
|
||||||
|
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user