fix: dashboard chart color

This commit is contained in:
prssanna 2020-02-24 19:38:16 +05:30
parent 9fa0424e22
commit 18a8c8d3c0
2 changed files with 2 additions and 3 deletions

View file

@ -432,10 +432,9 @@ class DashboardChart {
"Pie": 'pie'
};
let chart_type = chart_type_map[this.chart_doc.chart_type];
let colors = [];
if (chart_type in ['Line', 'Bar']) {
if (['Line', 'Bar'].includes(this.chart_doc.type)) {
colors = [this.chart_doc.color || "light-blue"];
}

View file

@ -47,6 +47,7 @@ frappe.ui.form.on('Dashboard Chart', {
}
});
$(frm.get_field('y_field').wrapper).empty();
frm.set_df_property("filters_section", "hidden", 1);
frm.set_query('document_type', function() {
return {
@ -105,7 +106,6 @@ frappe.ui.form.on('Dashboard Chart', {
frm.set_value('x_field', '');
frm.set_value('y_field', '[]');
frm.set_df_property('x_field', 'options', []);
$(frm.get_field('y_field').wrapper).empty();
frm.set_value('filters_json', '{}');
frm.trigger('set_chart_report_filters');
},