The Chinese Zodiac is a complex system. Its origins predate Buddhism. The Twelve Earthy Branches were created first. It is thought they were originally used to predict planting and harvest time.

Later, the Ten Heavenly Stems were created based on the Chinese myth that the Earth had ten suns. Each sun was supposed to rise each day, in order. The Ten Heavenly Stems were created during the Shang Dynasty to mark this cycle. 

Today, these symbols overlay the Twelve Earthly Branches and are vital to both the Chinese calendar and the Chinese Zodiac. In the Zodiac, each Heavenly Stem has both a Yin and a Yang designation, and each Stem has a relationship with its Element. The Ten Heavenly Stems are their Element associations are as followed. (all Stems are listed in Pinyin).
Ji? and y? – Element – Wood
b?ng and d?ng – Fire
wù and j?- Earth
g?ng and x?n– Metal
rén and gu?- Water 

The person’s Yin or Yang is determined by the year of their birth, based on the Chinese calendar. Those years which end in an even number (0, 2, 4, 6, or 8) are Yang. Odd years (1, 3, 5, 7, 9) are Yin. 

It is very important to remember that the Chinese New Year falls on a different day from the Western New Year. Even though China recognizes the Western calendar, they do not use it for the purpose of traditional Chinese astrology. The Chinese set their holidays, astrology, and celebrations based on their traditional cyclidic calendar. Also, the Chinese New Year is based on the flow of the cycles. It is not the same day or date each year but always falls somewhere in the months of either January or February. For this reason, many people who have birthdays in either of those months may have incorrectly drawn charts.