How to load date[] from the Apex chart with msg.payload?

If I put the index.html and the index.js within a ui_template, will it work the same way?