Skip to content

Commit

Permalink
fix: Format currency values in dashboard chart
Browse files Browse the repository at this point in the history
  • Loading branch information
netchampfaris committed Mar 18, 2021
1 parent cf2eacb commit 8fcee4e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion frappe/public/js/frappe/widgets/chart_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ export default class ChartWidget extends Widget {

this.fetch(this.filters, true, this.args).then(data => {
if (this.chart_doc.chart_type == "Report") {
this.report_result = data;
this.summary = data.report_summary;
data = this.get_report_chart_data(data);
}
Expand Down Expand Up @@ -571,6 +572,13 @@ export default class ChartWidget extends Widget {
axisOptions: {
xIsSeries: this.chart_doc.timeseries,
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 })
}
};

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

0 comments on commit 8fcee4e

Please sign in to comment.