mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-09 13:52:23 +00:00
BBIM 4D: Enable displaying task tooltip in the gantt chart & add resource columns
This commit is contained in:
@@ -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
|
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.
|
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,
|
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.
|
vShowComp: false, // Disable the completion column.
|
||||||
vShowDur: false, // Disable the duration column, because jsgantt doesn't calculate durations the way we want.
|
vShowDur: false, // Disable the duration column, because jsgantt doesn't calculate durations the way we want.
|
||||||
vAdditionalHeaders: {ifcduration: {title: 'Duration'}},
|
vAdditionalHeaders: {ifcduration: {title: 'Duration'}, "resourceUsage": {title: 'Resource Usage'}},
|
||||||
vUseToolTip: false, // Disable tooltips.
|
vUseToolTip: true, // Disable tooltips.
|
||||||
|
vTooltipTemplate: generateTooltip,
|
||||||
vTotalHeight: 900,
|
vTotalHeight: 900,
|
||||||
});
|
});
|
||||||
JSGantt.parseJSONString(json_data, g);
|
JSGantt.parseJSONString(json_data, g);
|
||||||
@@ -32,6 +33,20 @@ function set_language(e){
|
|||||||
g.Draw();
|
g.Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function generateTooltip(task) {
|
||||||
|
var dataObject = task.getDataObject();
|
||||||
|
var numberResources = dataObject.resourceUsage ? dataObject.resourceUsage : "NULL"; ;
|
||||||
|
return `
|
||||||
|
<dl>
|
||||||
|
<dt>Name:</dt><dd>{{pName}}</dd>
|
||||||
|
<dt>Start:</dt><dd>{{pStart}}</dd>
|
||||||
|
<dt>End:</dt><dd>{{pEnd}}</dd>
|
||||||
|
<dt>Duration:</dt><dd>${dataObject.ifcduration}</dd>
|
||||||
|
<dt>Number of Resources:</dt><dd>${numberResources}</dd>
|
||||||
|
<dt>Resources:</dt><dd>{{pRes}}</dd>
|
||||||
|
</dl>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
function draw_table(json_object){
|
function draw_table(json_object){
|
||||||
let table = document.createElement("table");
|
let table = document.createElement("table");
|
||||||
|
|||||||
Reference in New Issue
Block a user