Merge pull request #30958 from gavindsouza/dashboard-chart-fixes

fix(charts): Pass fieldtype for chart data in selling reports
This commit is contained in:
Ankush Menat 2022-05-10 17:40:01 +05:30 committed by GitHub
commit 15fdc1cf7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 0 deletions

View File

@ -238,4 +238,5 @@ def get_chart_data(data):
"datasets": [{"name": _("Total Sales Amount"), "values": datapoints[:30]}],
},
"type": "bar",
"fieldtype": "Currency",
}

View File

@ -54,4 +54,5 @@ def get_chart_data(data, conditions, filters):
},
"type": "line",
"lineOptions": {"regionFill": 1},
"fieldtype": "Currency",
}

View File

@ -415,3 +415,8 @@ class Analytics(object):
else:
labels = [d.get("label") for d in self.columns[1 : length - 1]]
self.chart = {"data": {"labels": labels, "datasets": []}, "type": "line"}
if self.filters["value_quantity"] == "Value":
self.chart["fieldtype"] = "Currency"
else:
self.chart["fieldtype"] = "Float"

View File

@ -51,4 +51,5 @@ def get_chart_data(data, conditions, filters):
},
"type": "line",
"lineOptions": {"regionFill": 1},
"fieldtype": "Currency",
}