Merge pull request #16218 from deepeshgarg007/analytics-graph
[Bug-fix] Analytics report graph skipping quarter values bug fix
This commit is contained in:
commit
a78947f2de
@ -77,9 +77,20 @@ frappe.query_reports["Purchase Analytics"] = {
|
|||||||
events: {
|
events: {
|
||||||
onCheckRow: function(data) {
|
onCheckRow: function(data) {
|
||||||
row_name = data[2].content;
|
row_name = data[2].content;
|
||||||
row_values = data.slice(5).map(function (column) {
|
length = data.length;
|
||||||
return column.content;
|
|
||||||
})
|
var tree_type = frappe.query_report.filters[0].value;
|
||||||
|
|
||||||
|
if(tree_type == "Supplier" || tree_type == "Item") {
|
||||||
|
row_values = data.slice(4,length-1).map(function (column) {
|
||||||
|
return column.content;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row_values = data.slice(3,length-1).map(function (column) {
|
||||||
|
return column.content;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
'name':row_name,
|
'name':row_name,
|
||||||
|
@ -76,10 +76,21 @@ frappe.query_reports["Sales Analytics"] = {
|
|||||||
events: {
|
events: {
|
||||||
onCheckRow: function(data) {
|
onCheckRow: function(data) {
|
||||||
row_name = data[2].content;
|
row_name = data[2].content;
|
||||||
length = data.length
|
length = data.length;
|
||||||
row_values = data.slice(4,length-1).map(function (column) {
|
|
||||||
return column.content;
|
var tree_type = frappe.query_report.filters[0].value;
|
||||||
})
|
|
||||||
|
if(tree_type == "Customer" || tree_type == "Item") {
|
||||||
|
row_values = data.slice(4,length-1).map(function (column) {
|
||||||
|
return column.content;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
row_values = data.slice(3,length-1).map(function (column) {
|
||||||
|
return column.content;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
entry = {
|
entry = {
|
||||||
'name':row_name,
|
'name':row_name,
|
||||||
'values':row_values
|
'values':row_values
|
||||||
|
@ -276,7 +276,11 @@ class Analytics(object):
|
|||||||
|
|
||||||
def get_chart_data(self):
|
def get_chart_data(self):
|
||||||
length = len(self.columns)
|
length = len(self.columns)
|
||||||
labels = [d.get("label") for d in self.columns[2:length-1]]
|
|
||||||
|
if self.filters.tree_type in ["Customer", "Supplier", "Item"]:
|
||||||
|
labels = [d.get("label") for d in self.columns[2:length-1]]
|
||||||
|
else:
|
||||||
|
labels = [d.get("label") for d in self.columns[1:length-1]]
|
||||||
self.chart = {
|
self.chart = {
|
||||||
"data": {
|
"data": {
|
||||||
'labels': labels,
|
'labels': labels,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user