Your code appears fine (with appropriate data), so the issue is with your data... please see this FAQ on the correct way to sure your data.