Convert string of variable length to floats.

Hello!
At the moment my problem is fix the drawpixel function to prevent it from being drawn lines ranging from 0 hour/6 as shown in the image below:

I want the chart that look like this:

The error should be in this code snippet, but I do not know how to write it correctly.

 for (uint8_t j=0; j <=(hora/6) ;j++)
 {
 setFont(SMALL, 255, 0, 255, 0, 0, 0);
 myGLCD.drawPixel((40+j),grafico);
  }

Thank you.
Fernando Garcia