Strange Results With a 3x7 Segment LEDs
The wiring on your schematic only agrees with the datasheet up to pin 5. 

Then the datasheet implies Pin 6 is missing or disconnected and the remaining pins 7-12 are connected. Also DIP pins are conventionally numbered down one side and up the other. So your pin numbered 6 is probably Pin 12 on the LED, 7 is probably 11, and so on until your pin 11 is the datasheet pin 7.

This will be easy to confirm with a multimeter. Once confirmed, it is fixable in software. 

Dave Tweed is right about the current limiting; unless you have simply omitted the resistors on the drawing to simplify it. You need 8, probably 330R, on the anodes. (3 resistors on the cathodes would vary the brightness according to the display data!)