getTaskPosition method requires the task object to get the vertical and horizontal position of the sizes. And anyway, you will need to draw a dummy task bar in the timeline, isn’t it? So, you can choose a task row and use the task object from that row. Otherwise, you just need to take the first task in the chart, if you only need horizontal sizes.
If you hover an ordinary task and want to show a dummy task only during that time, it would be easier to do that by using the
Here is an example of how it can be implemented: