瀏覽代碼

fix: check if report result exists before formatting

version-14
prssanna 4 年之前
父節點
當前提交
c0e949e809
共有 1 個檔案被更改,包括 5 行新增2 行删除
  1. +5
    -2
      frappe/public/js/frappe/widgets/chart_widget.js

+ 5
- 2
frappe/public/js/frappe/widgets/chart_widget.js 查看文件

@@ -573,14 +573,17 @@ export default class ChartWidget extends Widget {
xIsSeries: this.chart_doc.timeseries, xIsSeries: this.chart_doc.timeseries,
shortenYAxisNumbers: 1 shortenYAxisNumbers: 1
}, },
tooltipOptions: {
};

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


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


Loading…
取消
儲存