diff --git a/frappe/core/page/background_jobs/background_jobs.html b/frappe/core/page/background_jobs/background_jobs.html index 37ec25cc48..793dadfa28 100644 --- a/frappe/core/page/background_jobs/background_jobs.html +++ b/frappe/core/page/background_jobs/background_jobs.html @@ -11,7 +11,7 @@ {% for j in jobs %} - {{ j.queue }} + {{ j.queue.split(".").slice(-1)[0] }}
{{ frappe.utils.encode_tags(j.job_name) }} diff --git a/frappe/docs/user/en/guides/desk/making_charts_in_c3js.md b/frappe/docs/user/en/guides/desk/making_charts_in_c3js.md new file mode 100644 index 0000000000..91a5d9438a --- /dev/null +++ b/frappe/docs/user/en/guides/desk/making_charts_in_c3js.md @@ -0,0 +1,35 @@ +# Making Charts using c3.js + +Frappe bundles the c3.js libary to make charts inside the app and provides a wrapper class so that you can start using charts out of the box. To use chart, you need the x and y data, make a wrapper block and then just make the chart object. + +### Time Series Example + + page.chart = new frappe.ui.Chart({ + // attach the chart here + wrapper: $('
').appendTo(page.body), + + // pass the data, like + // ['x', '2016-01-01', '2016-01-02'] + // ['Value', 20, 30] + data: { + x: 'x', + xFormat: '%Y-%m-%d', + columns: [data[0], data[1]], + }, + legend: { + show: false + }, + axis: { + x: { + type: 'timeseries', + }, + y: { + min: 0, + padding: {bottom: 10} + } + } + }); + +### Help + +For more options, see the [c3js.org](http://c3js.org/examples.html) docs \ No newline at end of file diff --git a/frappe/public/js/frappe/form/dashboard.js b/frappe/public/js/frappe/form/dashboard.js index 1a75bdc5a6..d604c6a09d 100644 --- a/frappe/public/js/frappe/form/dashboard.js +++ b/frappe/public/js/frappe/form/dashboard.js @@ -341,10 +341,11 @@ frappe.ui.form.Dashboard = Class.extend({ } }, - // stats - add_stats: function(html) { - this.stats_area.html(html).removeClass('hidden'); + add_indicator: function(label, color) { this.show(); + this.stats_area.removeClass('hidden'); + return $('
' + +label+'
').appendTo(this.stats_area); }, //graphs diff --git a/frappe/public/js/frappe/form/templates/form_dashboard.html b/frappe/public/js/frappe/form/templates/form_dashboard.html index 11fc8c4782..bc7352cebd 100644 --- a/frappe/public/js/frappe/form/templates/form_dashboard.html +++ b/frappe/public/js/frappe/form/templates/form_dashboard.html @@ -8,7 +8,7 @@
- +