Преглед на файлове

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,
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);


Зареждане…
Отказ
Запис