Skip to content

Commit a5cb1bd

Browse files
savvinsergeyignatvilesov
authored andcommitted
Fixed issue with wrong selection of children tasks from legend (#95)
1 parent e482002 commit a5cb1bd

File tree

4 files changed

+20
-2
lines changed

4 files changed

+20
-2
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
## 1.9.2
2+
* Fixed issue with wrong selection of children tasks from legend
13
## 1.9.1
24
* Fixed issue with wrong tooltip data displaying without 'parent' data
35
* Fixed issue with wrong duration in the tooltip

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "powerbi-visuals-gantt",
3-
"version": "1.9.1",
3+
"version": "1.9.2",
44
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
55
"repository": {
66
"type": "git",

pbiviz.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Gantt",
55
"guid": "Gantt1448688115699",
66
"visualClassName": "Gantt",
7-
"version": "1.9.1",
7+
"version": "1.9.2",
88
"description": "A Gantt chart is a type of bar chart which illustrates a project timeline or schedule. The Gantt Chart visual shows the Tasks, Start Dates, Durations, % Complete, and Resources for a project. The Gantt Chart visual can be used to show current schedule status using percent-complete shadings and a vertical \"TODAY\" line. The Legend may be used to group or filter tasks based upon data values.",
99
"supportUrl": "http://community.powerbi.com",
1010
"gitHubUrl": "https://github.com/Microsoft/powerbi-visuals-gantt"

src/behavior.ts

+16
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,22 @@ module powerbi.extensibility.visual {
4646
(d3.event as MouseEvent).stopPropagation();
4747
});
4848

49+
options.legendSelection.on("click", (d: any) => {
50+
if (!d.selected) {
51+
selectionHandler.handleSelection(d, true);
52+
(d3.event as MouseEvent).stopPropagation();
53+
54+
let selectedType: string = d.tooltip;
55+
options.taskSelection.each((d: Task) => {
56+
if (d.taskType === selectedType && d.parent && !d.selected) {
57+
selectionHandler.handleSelection(d, true);
58+
}
59+
});
60+
} else {
61+
selectionHandler.handleClearSelection();
62+
}
63+
});
64+
4965
options.subTasksCollapse.selection.on("click", (d: GroupedTask) => {
5066
if (!_.flatten(d.tasks.map(task => task.children)).length) {
5167
return;

0 commit comments

Comments
 (0)