Calling generic java script

I have a webix panel and all the webix components are loading fine.I am trying to integrate a generic java script that will create an object,set some properties and calls a draw method to create the UI.It is working fine when i load it from an HTML file.When i call it from webix panel the error i am getting is “object name is not defined” in chrome.How do i call an external js from webix.

webix.ui({
    id: "layout",
    rows: [{
             responsive: "layout",
            cols: [{
              container:"ExternalChartDIV",
              onload:generateChart()
            },
            {
                view: "chart", type: "bar", width:600,
                height:400,
                barWidth: 60,
                radius: 5,
                gradient: "rising",
                xAxis: {
                    template: "#c#"
                },
                yAxis: {
                title: ""
                }
            }]
      }]
});

generateChart() is from the external js.

Thanks,

if you want to call function later you need to use code like next

{
  container:"ExternalChartDIV",
  onload:function(){ generateChart() }
},

When you are using the function call directly as in the original code, the function will be executed before initialization of UI and result of function will be used as value for onload

Also, if you want to create some custom UI - check

It shows how custom view can be created.

Or you could just use

onload: generateChart

to pass the function object instead of creating a wrapper.