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.
This commit is contained in:
Ankush Menat 2022-07-15 13:29:17 +05:30 committed by Ankush Menat
parent d7446fd3ae
commit ceeea6180e
2 changed files with 4 additions and 10 deletions

View File

@ -130,11 +130,8 @@ frappe.query_reports["Purchase Analytics"] = {
labels: raw_data.labels, labels: raw_data.labels,
datasets: new_datasets, datasets: new_datasets,
}; };
chart_options = { const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
data: new_data, frappe.query_report.render_chart(new_options);
type: "line",
};
frappe.query_report.render_chart(chart_options);
frappe.query_report.raw_chart_data = new_data; frappe.query_report.raw_chart_data = new_data;
}, },

View File

@ -109,11 +109,8 @@ frappe.query_reports["Sales Analytics"] = {
labels: raw_data.labels, labels: raw_data.labels,
datasets: new_datasets, datasets: new_datasets,
}; };
const new_options = Object.assign({}, frappe.query_report.chart_options, {data: new_data});
frappe.query_report.render_chart({ frappe.query_report.render_chart(new_options);
data: new_data,
type: "line",
});
frappe.query_report.raw_chart_data = new_data; frappe.query_report.raw_chart_data = new_data;
}, },