fix: dont override default report options in charts
Sales analytics and purchase analytics reports are clearing the default
options which includes number shortening, axis options etc. This makes
report unreadable when dealing with large numbers.
diff --git a/erpnext/buying/report/purchase_analytics/purchase_analytics.js b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
index ba8535a..e70e431 100644
--- a/erpnext/buying/report/purchase_analytics/purchase_analytics.js
+++ b/erpnext/buying/report/purchase_analytics/purchase_analytics.js
@@ -130,11 +130,8 @@
labels: raw_data.labels,
datasets: new_datasets,
};
- chart_options = {
- data: new_data,
- type: "line",
- };
- frappe.query_report.render_chart(chart_options);
+ const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
+ frappe.query_report.render_chart(new_options);
frappe.query_report.raw_chart_data = new_data;
},
diff --git a/erpnext/selling/report/sales_analytics/sales_analytics.js b/erpnext/selling/report/sales_analytics/sales_analytics.js
index d527e42..d994496 100644
--- a/erpnext/selling/report/sales_analytics/sales_analytics.js
+++ b/erpnext/selling/report/sales_analytics/sales_analytics.js
@@ -109,11 +109,8 @@
labels: raw_data.labels,
datasets: new_datasets,
};
-
- frappe.query_report.render_chart({
- data: new_data,
- type: "line",
- });
+ const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
+ frappe.query_report.render_chart(new_options);
frappe.query_report.raw_chart_data = new_data;
},