Skip to content

Commit

Permalink
Tooltip improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
DlhSoftTeam committed Oct 31, 2019
1 parent e324c83 commit 93d8399
Show file tree
Hide file tree
Showing 460 changed files with 15,414 additions and 15,716 deletions.
Binary file not shown.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ angular.module('GanttChartViewSample', ['DlhSoft.ProjectData.GanttChart.Directiv
// alternativeItemStyle: 'background-color: #f9f9f9', alternativeChartItemStyle: 'fill: #f9f9f9',
// itemTemplate: function(item) {
// var toolTip = document.createElementNS('http://www.w3.org/2000/svg', 'title');
// var toolTipContent = item.content + '' + 'Start: ' + item.start.toLocaleString();
// var toolTipContent = item.content + '\n' + 'Start: ' + item.start.toLocaleString();
// if (!item.isMilestone)
// toolTipContent += '' + 'Finish: ' + item.finish.toLocaleString();
// toolTipContent += '\n' + 'Finish: ' + item.finish.toLocaleString();
// toolTip.appendChild(document.createTextNode(toolTipContent));
// return toolTip;
// },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,43 +542,42 @@ function initializeGanttChartTemplates(settings, theme) {
var toolTip = document.createElementNS(svgns, 'title');
toolTip.appendChild(getTextNode(document, item.content));
if (typeof settings.areToolTipsSimplified === undefinedType || !settings.areToolTipsSimplified) {
toolTip.appendChild(document.createTextNode(' '));
if (typeof item.loadChartView === undefinedType) {
if (typeof item.scheduleChartView === undefinedType && item.parent) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Parent: ' + item.parent.content + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Parent: ' + item.parent.content));
}
if (typeof item.scheduleChartView !== undefinedType && item.scheduleChartItem) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Row: ' + item.scheduleChartItem.content + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Row: ' + item.scheduleChartItem.content));
}
if (item.hasChildren) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Children: ' + item.children.length + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Children: ' + item.children.length));
}
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode((!item.isMilestone ? 'Start: ' : '') + settings.dateTimeFormatter(ganttChartView.getOutputDate(item.start)) + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode((!item.isMilestone ? 'Start: ' : '') + settings.dateTimeFormatter(ganttChartView.getOutputDate(item.start))));
if (!item.isMilestone) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Finish: ' + settings.dateTimeFormatter(ganttChartView.getOutputDate(item.finish)) + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Finish: ' + settings.dateTimeFormatter(ganttChartView.getOutputDate(item.finish))));
}
if (settings.areTaskAssignmentsVisible && item.assignmentsContent) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Assignments: ' + item.assignmentsContent + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Assignments: ' + item.assignmentsContent));
}
if (!item.isMilestone) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Effort: ' + (ganttChartView.getItemTotalEffort(item) / hourDuration) + 'h' + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Effort: ' + (ganttChartView.getItemTotalEffort(item) / hourDuration) + 'h'));
if (settings.isTaskCompletedEffortVisible) {
var completion = ganttChartView.getItemCompletion(item);
if (!isNaN(completion)) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Completed: ' + (Math.round(completion * 100 * 100) / 100) + '%' + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Completed: ' + (Math.round(completion * 100 * 100) / 100) + '%'));
}
}
}
if (settings.areTaskDependenciesVisible && item.predecessors && item.predecessors.length > 0) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('\n'));
var predecessorsString = '';
for (var i = 0; i < item.predecessors.length; i++) {
var predecessor = item.predecessors[i];
Expand All @@ -590,12 +589,12 @@ function initializeGanttChartTemplates(settings, theme) {
if (predecessor.dependencyType)
predecessorsString += ' (' + getDependencyTypeString(predecessor.dependencyType) + ')';
}
toolTip.appendChild(document.createTextNode('Predecessors: ' + predecessorsString + ' '));
toolTip.appendChild(document.createTextNode('Predecessors: ' + predecessorsString));
}
}
else if (!isNaN(item.units)) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(document.createTextNode('Allocation: ' + (Math.round(item.units * 100 * 100) / 100) + '% '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(document.createTextNode('Allocation: ' + (Math.round(item.units * 100 * 100) / 100) + '%'));
}
}
return toolTip;
Expand All @@ -605,14 +604,13 @@ function initializeGanttChartTemplates(settings, theme) {
var toolTip = document.createElementNS(svgns, 'title');
toolTip.appendChild(getTextNode(document, predecessorItem.item.content + ' - ' + item.content));
if (typeof settings.areToolTipsSimplified === undefinedType || !settings.areToolTipsSimplified) {
toolTip.appendChild(document.createTextNode(' '));
if (predecessorItem.dependencyType) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(getTextNode(document, 'Type: ' + getDependencyTypeString(predecessorItem.dependencyType) + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(getTextNode(document, 'Type: ' + getDependencyTypeString(predecessorItem.dependencyType)));
}
if (predecessorItem.lag) {
toolTip.appendChild(document.createElement('br'));
toolTip.appendChild(getTextNode(document, 'Lag: ' + (predecessorItem.lag / hourDuration) + 'h' + ' '));
toolTip.appendChild(document.createTextNode('\n'));
toolTip.appendChild(getTextNode(document, 'Lag: ' + (predecessorItem.lag / hourDuration) + 'h'));
}
}
return toolTip;
Expand Down
Binary file not shown.
Loading

0 comments on commit 93d8399

Please sign in to comment.