Merge pull request #13270 from pratu16x7/charts-fix
Update Charts to v1
diff --git a/erpnext/accounts/report/balance_sheet/balance_sheet.py b/erpnext/accounts/report/balance_sheet/balance_sheet.py
index 18b07ea..97990fa 100644
--- a/erpnext/accounts/report/balance_sheet/balance_sheet.py
+++ b/erpnext/accounts/report/balance_sheet/balance_sheet.py
@@ -132,11 +132,11 @@
datasets = []
if asset_data:
- datasets.append({'title':'Assets', 'values': asset_data})
+ datasets.append({'name':'Assets', 'values': asset_data})
if liability_data:
- datasets.append({'title':'Liabilities', 'values': liability_data})
+ datasets.append({'name':'Liabilities', 'values': liability_data})
if equity_data:
- datasets.append({'title':'Equity', 'values': equity_data})
+ datasets.append({'name':'Equity', 'values': equity_data})
chart = {
"data": {
diff --git a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
index 466562b..5b2f5d6 100644
--- a/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
+++ b/erpnext/accounts/report/profit_and_loss_statement/profit_and_loss_statement.py
@@ -75,11 +75,11 @@
datasets = []
if income_data:
- datasets.append({'title': 'Income', 'values': income_data})
+ datasets.append({'name': 'Income', 'values': income_data})
if expense_data:
- datasets.append({'title': 'Expense', 'values': expense_data})
+ datasets.append({'name': 'Expense', 'values': expense_data})
if net_profit:
- datasets.append({'title': 'Net Profit/Loss', 'values': net_profit})
+ datasets.append({'name': 'Net Profit/Loss', 'values': net_profit})
chart = {
"data": {
diff --git a/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js b/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
index cdfdad1..92d026a 100644
--- a/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
+++ b/erpnext/crm/report/minutes_to_first_response_for_opportunity/minutes_to_first_response_for_opportunity.js
@@ -23,7 +23,7 @@
data: {
labels: result.map(d => d[0]),
datasets: [{
- title: 'Mins to first response',
+ name: 'Mins to first response',
values: result.map(d => d[1])
}]
},
diff --git a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
index 93ea11c..7788a07 100644
--- a/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
+++ b/erpnext/hr/report/vehicle_expenses/vehicle_expenses.py
@@ -69,12 +69,12 @@
datasets = []
if fuel_exp_data:
datasets.append({
- 'title': 'Fuel Expenses',
+ 'name': 'Fuel Expenses',
'values': fuel_exp_data
})
if service_exp_data:
datasets.append({
- 'title': 'Service Expenses',
+ 'name': 'Service Expenses',
'values': service_exp_data
})
chart = {
diff --git a/erpnext/manufacturing/page/production_analytics/production_analytics.js b/erpnext/manufacturing/page/production_analytics/production_analytics.js
index efbd0a5..a40177c 100644
--- a/erpnext/manufacturing/page/production_analytics/production_analytics.js
+++ b/erpnext/manufacturing/page/production_analytics/production_analytics.js
@@ -64,8 +64,7 @@
var chart_data = this.get_chart_data ? this.get_chart_data() : null;
- this.chart = new Chart({
- parent: ".chart",
+ this.chart = new Chart(".chart", {
data: chart_data,
type: 'line'
});
diff --git a/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js b/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
index 4cf07fa..034e777 100644
--- a/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
+++ b/erpnext/support/report/minutes_to_first_response_for_issues/minutes_to_first_response_for_issues.js
@@ -20,7 +20,7 @@
data: {
labels: result.map(d => d[0]),
datasets: [{
- title: 'Mins to first response',
+ name: 'Mins to first response',
values: result.map(d => d[1])
}]
},
diff --git a/erpnext/utilities/page/leaderboard/leaderboard.js b/erpnext/utilities/page/leaderboard/leaderboard.js
index 746ac79..af62dad 100644
--- a/erpnext/utilities/page/leaderboard/leaderboard.js
+++ b/erpnext/utilities/page/leaderboard/leaderboard.js
@@ -146,7 +146,6 @@
me.$graph_area.show().empty();
let args = {
- parent: '.leaderboard-graph',
data: {
datasets: [
{
@@ -160,7 +159,7 @@
type: 'bar',
height: 140
};
- new Chart(args);
+ new Chart('.leaderboard-graph', args);
notify(me, r, $container);
}
@@ -280,7 +279,7 @@
fields.map(col => {
let val = item[col];
if(col=="name") {
- var formatted_value = `<a class="grey list-id ellipsis"
+ var formatted_value = `<a class="grey list-id ellipsis"
href="#Form/${me.options.selected_doctype}/${item["name"]}"> ${val} </a>`
} else {
var formatted_value = `<span class="text-muted ellipsis">