First, I would read this introduction on DataView: DataView Introduction
Also go over DataViewMappings here: DataViewMappings
Then follow this great example: Build Your Custom Visuals Power BI
I believe those three links above will set you on the right track. Good luck.