Widget Woes (RESOLVED)
Posted: Fri Aug 23, 2019 5:30 pm
I'm trying to implement a widget around FushionCharts - a popular charting js library we've being using for years. I can get it to display something if put all the code in the onRealizeControl but that's not realistic for real world use. I have
PROTOTYPE.onRealizeControl = function( parentDiv )
{
parentDiv.id = "charthere";
this.m_chart = new FusionCharts({type: 'line'});
this.m_chart.height= '100%';
this.m_chart.width='100%';
}
and later
PROTOTYPE.UpdateXML = function()
{
this.chart.setXMLData('some XML');
}
This produces the error
Cannot read property 'setXMLData' of undefined
It can't seem to find this.chart even though it was created at onRealizeControl.
I'm a bit in the dark, any suggestions would be great.
Cheers
Jim
PROTOTYPE.onRealizeControl = function( parentDiv )
{
parentDiv.id = "charthere";
this.m_chart = new FusionCharts({type: 'line'});
this.m_chart.height= '100%';
this.m_chart.width='100%';
}
and later
PROTOTYPE.UpdateXML = function()
{
this.chart.setXMLData('some XML');
}
This produces the error
Cannot read property 'setXMLData' of undefined
It can't seem to find this.chart even though it was created at onRealizeControl.
I'm a bit in the dark, any suggestions would be great.
Cheers
Jim