Skip to content

Commit

Permalink
fix: dont override default report options in charts
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ankush committed Jul 15, 2022
1 parent d7446fd commit ceeea61
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,8 @@ frappe.query_reports["Purchase Analytics"] = {
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;
},
Expand Down
7 changes: 2 additions & 5 deletions erpnext/selling/report/sales_analytics/sales_analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,8 @@ frappe.query_reports["Sales Analytics"] = {
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;
},
Expand Down

0 comments on commit ceeea61

Please sign in to comment.