use the new frappe charts :D (#11391)
diff --git a/.eslintrc b/.eslintrc
index c9cd552..4dd1216 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -132,6 +132,7 @@
"get_url_arg": true,
"get_server_fields": true,
"set_multiple": true,
- "QUnit": true
+ "QUnit": true,
+ "Chart": true
}
}
diff --git a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
index 56db392..ba5b7f2 100644
--- a/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
+++ b/erpnext/accounts/report/accounts_receivable/accounts_receivable.py
@@ -309,14 +309,16 @@
rows = []
for d in data:
- rows.append(d[self.ageing_col_idx_start : self.ageing_col_idx_start+4])
-
- if rows:
- rows.insert(0, [[d.get("label")] for d in ageing_columns])
+ rows.append(
+ {
+ 'values': d[self.ageing_col_idx_start : self.ageing_col_idx_start+4]
+ }
+ )
return {
"data": {
- 'labels': rows
+ 'labels': [d.get("label") for d in ageing_columns],
+ 'datasets': rows
},
"type": 'percentage'
}
diff --git a/erpnext/manufacturing/page/production_analytics/production_analytics.js b/erpnext/manufacturing/page/production_analytics/production_analytics.js
index 39168b7..efbd0a5 100644
--- a/erpnext/manufacturing/page/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/page/production_analytics/production_analytics.js
@@ -64,7 +64,7 @@
var chart_data = this.get_chart_data ? this.get_chart_data() : null;
- this.chart = new frappe.chart.FrappeChart({
+ this.chart = new Chart({
parent: ".chart",
data: chart_data,
type: 'line'