display gantt chart by radio button problem

i want to display gantt chart by click on radio button.
but im facing problem, the task was not reset in chart but just add into the chart.
any suggestion for this issue?

this is the radio button code:

<input id="choose" type='radio' value="<?php echo $row['proid']; ?>" onchange="paginationlabelclicked(this);"  name='choose'>

and this is javascript code

[code] function paginationlabelclicked(radio){

            var radios = document.getElementsByName('choose');
            var id = '';
            for (var i = 0, length = radios.length; i < length; i++) {
                if (radios[i].checked) {
                  id = radios[i].value;
            gantt.config.xml_date = "%Y-%m-%d %H:%i"; 
            gantt.load('data.php?proid='+ id);

           var dp=new dataProcessor('data.php?proid='+ id);   

you can clear previously loaded items using gantt.clearAll()