jlmontes@rauroszm.com Posted October 6, 2016 Share Posted October 6, 2016 Hello, I have uniGUI_Professional_0.99.96.1329. I have one TuniURLFrame with this HTML: <!DOCTYPE html> <html style="height:95%"> <head> <script src="/files/TeeChart/teechart.js" type="text/javascript"></script> <script type="text/javascript"> var Chart1; function draw() { Chart1=new Tee.Chart("canvas"); Chart1.panel.transparent=true; Chart1.walls.back.format.shadow.visible=true; Chart1.title.text=""; Chart1.addSeries(new Tee.Line()).addRandom(1000); resize(Chart1); }; function resize(chart) { if (!chart) return; var canvas = chart.canvas; var w=800; canvas.width=w; canvas.setAttribute('width', ""+w+"px"); var h=800; canvas.height=h; canvas.setAttribute('height', ""+h+"px"); canvas.style.width=""+w+"px"; canvas.style.height=""+h+"px"; chart.bounds.width=w; chart.bounds.height=h; chart.draw(); }; </script> </head> <body onload="draw()" onresize="resize(Chart1)" style="margin:0; padding:0; min-height:100%; height:100%; overflow:hidden"> <br><canvas id="canvas" style="height:400; width:800; align: center;"> </canvas> </body></html> This html works wel. When in the delphi source code execute this command: UniSession.AddJS( 'Chart1.addSeries(new Tee.Line()).addRandom(1000);') I get one error: "Chart1 is not defined" How I can access to Chart1 var?? Thanks Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted October 6, 2016 Share Posted October 6, 2016 Use UniHTML Frame The problem is in the first line of source that is var chart1; remove it and you are done. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now