Gantt not Refreshing data

I’m trying to open my tasks in the gantt, according to my Project selected.
But, when i select any other project, to display the new tasks in the gantt, it’s merging the previous tasks and chart with the new one.

When I select the project and open the gantt by the first time, it works fine, but when i change the project, the “problem” occurs.

Hi,
please give a link to the page, or show some code so we could better understand what are you doing