score:0

the following line is redundant.

var ctx = document.getelementbyid($this.attr('id'));

instead, the $this variable is already a pointer to the element.

meaning - you can do:

var plot = new chart($this, {
    type: 'line',
    data: data,
});

my guess is that php is not creating two different id's, and javascript is left confused.


Related Query

More Query from same tag