fixed out of range error on vertical graph

Signed-off-by: tanji <nicholastanjerome@gmail.com>