From a6fb4cbfbfd54e568b402f420c0bd8dcd3f435f2 Mon Sep 17 00:00:00 2001 From: Sigma Dimensions <79010126+myoualid@users.noreply.github.com> Date: Wed, 3 May 2023 04:34:55 +0100 Subject: [PATCH] BBIM 4D: Enable displaying task tooltip in the gantt chart & add resource columns --- .../bim/module/sequence/gantt/index.js | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/sequence/gantt/index.js b/src/blenderbim/blenderbim/bim/module/sequence/gantt/index.js index ab03471d2d..50eb49a8b6 100644 --- a/src/blenderbim/blenderbim/bim/module/sequence/gantt/index.js +++ b/src/blenderbim/blenderbim/bim/module/sequence/gantt/index.js @@ -13,11 +13,12 @@ function create_gantt_chart(json_data) { vShowEndWeekDate: 0, // Show/Hide the date for the last day of the week in header for daily vUseSingleCell: 10000, // Set the threshold cell per table row (Helps performance for large data. vFormatArr: ['Day', 'Week', 'Month', 'Quarter'], // Even with setUseSingleCell using Hour format on such a large chart can cause issues in some browsers, - vShowRes: false, // Disable the resource column. + vShowRes: true, // Disable the resource column. vShowComp: false, // Disable the completion column. vShowDur: false, // Disable the duration column, because jsgantt doesn't calculate durations the way we want. - vAdditionalHeaders: {ifcduration: {title: 'Duration'}}, - vUseToolTip: false, // Disable tooltips. + vAdditionalHeaders: {ifcduration: {title: 'Duration'}, "resourceUsage": {title: 'Resource Usage'}}, + vUseToolTip: true, // Disable tooltips. + vTooltipTemplate: generateTooltip, vTotalHeight: 900, }); JSGantt.parseJSONString(json_data, g); @@ -32,6 +33,20 @@ function set_language(e){ g.Draw(); } +function generateTooltip(task) { + var dataObject = task.getDataObject(); + var numberResources = dataObject.resourceUsage ? dataObject.resourceUsage : "NULL"; ; + return ` +