Browse Source

Merge pull request #12613 from netchampfaris/format-currency-in-dashboard-chart

fix: Format currency values in dashboard chart
version-14
mergify[bot] 4 years ago
committed by GitHub
parent
commit
aee03ed617
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      frappe/public/js/frappe/widgets/chart_widget.js

+ 9
- 1
frappe/public/js/frappe/widgets/chart_widget.js View File

@@ -208,6 +208,7 @@ export default class ChartWidget extends Widget {


this.fetch(this.filters, true, this.args).then(data => { this.fetch(this.filters, true, this.args).then(data => {
if (this.chart_doc.chart_type == "Report") { if (this.chart_doc.chart_type == "Report") {
this.report_result = data;
this.summary = data.report_summary; this.summary = data.report_summary;
data = this.get_report_chart_data(data); data = this.get_report_chart_data(data);
} }
@@ -571,6 +572,13 @@ export default class ChartWidget extends Widget {
axisOptions: { axisOptions: {
xIsSeries: this.chart_doc.timeseries, xIsSeries: this.chart_doc.timeseries,
shortenYAxisNumbers: 1 shortenYAxisNumbers: 1
},
tooltipOptions: {
formatTooltipY: value =>
frappe.format(value, {
fieldtype: this.report_result.chart.fieldtype,
options: this.report_result.chart.options
}, { always_show_decimals: true, inline: true })
} }
}; };


@@ -750,4 +758,4 @@ export default class ChartWidget extends Widget {
this.dashboard_chart && this.dashboard_chart.draw(true); this.dashboard_chart && this.dashboard_chart.draw(true);
}); });
} }
}
}

Loading…
Cancel
Save