Merge pull request #30961 from frappe/mergify/bp/version-13-hotfix/pr-30958
fix(charts): Pass fieldtype for chart data in selling reports (backport #30958)
This commit is contained in:
@@ -238,4 +238,5 @@ def get_chart_data(data):
|
||||
"datasets": [{"name": _(" Total Sales Amount"), "values": datapoints[:30]}],
|
||||
},
|
||||
"type": "bar",
|
||||
"fieldtype": "Currency",
|
||||
}
|
||||
|
||||
@@ -54,4 +54,5 @@ def get_chart_data(data, conditions, filters):
|
||||
},
|
||||
"type": "line",
|
||||
"lineOptions": {"regionFill": 1},
|
||||
"fieldtype": "Currency",
|
||||
}
|
||||
|
||||
@@ -416,3 +416,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"
|
||||
|
||||
@@ -53,4 +53,5 @@ def get_chart_data(data, conditions, filters):
|
||||
},
|
||||
"type": "line",
|
||||
"lineOptions": {"regionFill": 1},
|
||||
"fieldtype": "Currency",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user