def draw_chart(self,canvas,y,chart_type):
        if chart_type == 'cpu':
            chart_array = self.cpu_array
        else:
            chart_array = self.memory_array
        
        for i in range(self.CHART_LENGTH):
            if i >= 2:
                chart_array[i-2] = chart_array[i]
        # width of each peak is 2 units
        chart_array[self.CHART_LENGTH-1] = y
        chart_array[self.CHART_LENGTH-2] = y

        # now draw on the canvas
        for ctr in xrange(self.CHART_LENGTH):
            end_point = self.CHART_HEIGHT-chart_array[ctr]
            # end_point will be excluded
            for i in xrange(self.CHART_HEIGHT,end_point,-1):
                canvas.set(ctr,i)

        return canvas.frame(0,0,self.CHART_LENGTH,self.CHART_HEIGHT)
:param y: The next height to draw
dataset/ETHPy150Open black-perl/ptop/ptop/interfaces/GUI.py/PtopGUI.draw_chart