Merge pull request #16100 from deepeshgarg007/test-fix
Removed total label from graph
This commit is contained in:
commit
9a4cf4dce9
@ -73,7 +73,8 @@ frappe.query_reports["Sales Analytics"] = {
|
||||
events: {
|
||||
onCheckRow: function(data) {
|
||||
row_name = data[2].content;
|
||||
row_values = data.slice(4).map(function (column) {
|
||||
length = data.length
|
||||
row_values = data.slice(4,length-1).map(function (column) {
|
||||
return column.content;
|
||||
})
|
||||
entry = {
|
||||
@ -102,12 +103,12 @@ frappe.query_reports["Sales Analytics"] = {
|
||||
labels: raw_data.labels,
|
||||
datasets: new_datasets
|
||||
}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
frappe.query_report.chart.update(new_data)
|
||||
},200)
|
||||
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
frappe.query_report.chart.draw(true);
|
||||
}, 800)
|
||||
|
@ -166,7 +166,7 @@ class Analytics(object):
|
||||
for entity, period_data in iteritems(self.entity_periodic_data):
|
||||
row = {
|
||||
"entity": entity,
|
||||
"entity_name": self.entity_names.get(entity)
|
||||
"entity_name": self.entity_names.get(entity)
|
||||
}
|
||||
total = 0
|
||||
for dummy, end_date in self.periodic_daterange:
|
||||
@ -177,7 +177,7 @@ class Analytics(object):
|
||||
|
||||
row["total"] = total
|
||||
self.data.append(row)
|
||||
|
||||
|
||||
def get_rows_by_group(self):
|
||||
self.get_periodic_data()
|
||||
out = []
|
||||
@ -185,7 +185,7 @@ class Analytics(object):
|
||||
for d in reversed(self.group_entries):
|
||||
row = {
|
||||
"entity": d.name,
|
||||
"indent": self.depth_map.get(d.name)
|
||||
"indent": self.depth_map.get(d.name)
|
||||
}
|
||||
total = 0
|
||||
for dummy, end_date in self.periodic_daterange:
|
||||
@ -275,7 +275,8 @@ class Analytics(object):
|
||||
self.parent_child_map = frappe._dict(frappe.db.sql(""" select name, supplier_group from `tabSupplier`"""))
|
||||
|
||||
def get_chart_data(self):
|
||||
labels = [d.get("label") for d in self.columns[2:]]
|
||||
length = len(self.columns)
|
||||
labels = [d.get("label") for d in self.columns[2:length-1]]
|
||||
self.chart = {
|
||||
"data": {
|
||||
'labels': labels,
|
||||
|
@ -88,10 +88,9 @@ frappe.query_reports["Stock Analytics"] = {
|
||||
events: {
|
||||
onCheckRow: function(data) {
|
||||
row_name = data[2].content;
|
||||
row_values = data.slice(6).map(function (column) {
|
||||
row_values = data.slice(7).map(function (column) {
|
||||
return column.content;
|
||||
})
|
||||
|
||||
entry = {
|
||||
'name':row_name,
|
||||
'values':row_values
|
||||
@ -118,12 +117,12 @@ frappe.query_reports["Stock Analytics"] = {
|
||||
labels: raw_data.labels,
|
||||
datasets: new_datasets
|
||||
}
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
frappe.query_report.chart.update(new_data)
|
||||
},200)
|
||||
|
||||
|
||||
|
||||
|
||||
setTimeout(() => {
|
||||
frappe.query_report.chart.draw(true);
|
||||
}, 800)
|
||||
|
@ -167,13 +167,11 @@ def get_data(filters):
|
||||
return data
|
||||
|
||||
def get_chart_data(columns):
|
||||
labels = [d.get("label") for d in columns[4:]]
|
||||
labels = [d.get("label") for d in columns[5:]]
|
||||
chart = {
|
||||
"data": {
|
||||
'labels': labels,
|
||||
'datasets':[
|
||||
{ "values": ['0' for d in columns[4:]] }
|
||||
]
|
||||
'datasets':[]
|
||||
}
|
||||
}
|
||||
chart["type"] = "line"
|
||||
|
Loading…
x
Reference in New Issue
Block a user