I have implemented a Gantt chart to display the utilisation of resources which are in fact locations, so room1, room2 etc. I do however want the use of the rooms to be displayed on a single line and not multiple rows for each room. As such I have created a data source with 5 columns:- series, task, starttime, endtime and owner as in
"room1", "task", 2019-02-06 10:00, 2019-02-06 11:00, "Accounts Meeting"
"room1", "task", 2019-02-06 11:00, 2019-02-06 12:00, "Sales Meeting"
"room1", "task", 2019-02-06 12:20, 2019-02-06 13:00, "Lunch"
"Boardroom", "task", 2019-02-06 09:50, 2019-02-06 12:00, "Board Meeting"
"Boardroom", "task", 2019-02-06 14:00, 2019-02-06 15:00, "Staff Appraisals"
...and so on. I have set 'task' to be the same for all rows in the data as otherwise each task is listed on a separate line which is not what I want from a Gantt chart. When displayed I want one row for 'room1' with all uses of room1 along the row and a second row for 'Boardroom' with all of it's uses. The above data achieves this but probably is not how the control was designed as tool tips do not work correctly.
I therefore created a custom tooltip handler as per another article but i am having issues getting the tooltips to display the correct text which I want to be 'start time - end time (owner)' I have used the following code to obtain what I thought was the data item for the task for which the tool tip is to be displayed
Dim colIdx As Integer = context("DATA_COLUMN") Dim rowData = _data.Rows(colIdx).ItemArray
but this returns the same row of data for all of the tasks on the same row - i.e. all room 1 tasks return the same data row and as such the tool tip is always the same.
Is there an alternate way to display the above data in the way I need it to be or a way of getting the 'correct' data row for the item tooltip? Seems that this must be a common requirement as many Gantt charts I have seen show usage of a resource along the timeline...
Dear Chris,
We would like to mention that in order to have each line represent a set of “tasks” you need to define your tasks to be different for each new line that you need.
This means that your data would look something like this now:
room1, task, start-date, end-date, owner
Boardroom, task1, start-date, end-date, owner
BoardRoom, task1, start-date, end-date, owner
It should allow you to set each task one after the other and have them appear all on the same line.
Regarding the tooltip, we would like to mention that you should check your context for all of the properties that you have defined as it is where everything gets bound and it should appear if you have the appropriate data passed in.
Please refer to the sample that is attached to this reply for additional information.
Also if you have need of further assistance, please be sure to contact us again.
Gantt-Chart.rar