Skip to content

Commit

Permalink
fix: check if report result exists before formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
prssanna committed Mar 26, 2021
1 parent ab65f7a commit c0e949e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frappe/public/js/frappe/widgets/chart_widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,14 +573,17 @@ export default class ChartWidget extends Widget {
xIsSeries: this.chart_doc.timeseries,
shortenYAxisNumbers: 1
},
tooltipOptions: {
};

if (this.report_result && this.report_result.chart) {
chart_args.tooltipOptions = {
formatTooltipY: value =>
frappe.format(value, {
fieldtype: this.report_result.chart.fieldtype,
options: this.report_result.chart.options
}, { always_show_decimals: true, inline: true })
}
};
}

if (this.chart_doc.type == "Heatmap") {
const heatmap_year = parseInt(this.selected_heatmap_year || this.chart_settings.heatmap_year || this.chart_doc.heatmap_year);
Expand Down

0 comments on commit c0e949e

Please sign in to comment.