Profile completeness bar in percentage


I have website where users create their profile.

I want to show bar with % of profile complete.

For example if user enter personal details then 10% complete.User enter professional details then 50% complete etc.

Any JS libary OR php script to achive this.

Any idea?