| Page 1 of 1 | [ 3 posts ] |
Tim Ginn
|
I am trying to user the Yahoo Charts piece of this API.
I am able to get the example to work as long as the div is standing alone on the page. But the moment that I nest it down into the page where it is supposed to appear it will not work; Example code I am using is the exact script from the example page. I would post it but apparently yahoo is to cheap to allow longer post.... This works if its just in the page somewhere not nested. But if I: Code: <table><tr><td><div id="myContainer"></div></td></tr></table> or <div><div id="myContainer"></div></div> No go Oh and I also added a on ready function all ready to run when the DOM was ready and still the same results. Any help would be appreciated. |
Tim Ginn
|
The code I am using:
<div id="myContainer" style="width:100%"> </div> <script type="text/javascript"> // YAHOO.util.Event.onDOMReady(init); function init() { YAHOO.widget.Chart.SWFURL = "http://yui.yahooapis.com/2.9.0/build/charts/assets/charts.swf"; YAHOO.example.publicOpinion = [ { response: "Summer", count: 564815 }, { response: "Fall", count: 664182 }, { response: "Spring", count: 248124 }, { response: "Winter", count: 271214 }, { response: "Undecided", count: 81845 } ] var opinionData = new YAHOO.util.DataSource(YAHOO.example.publicOpinion); opinionData.responseType = YAHOO.util.DataSource.TYPE_JSARRAY; opinionData.responseSchema = { fields: ["response", "count"] }; //--- chart var mychart = new YAHOO.widget.PieChart("myContainer", opinionData, { dataField: "count", categoryField: "response", style: { padding: 20, legend: { display: "right", padding: 10, spacing: 5, font: { family: "Arial", size: 13 } } } }); }; function TestObj(id) { YAHOO.util.Event.onAvailable(id, this.handleOnAvailable, this); } TestObj.prototype.handleOnAvailable = init(); var obj = new TestObj("myContainer"); |
Tim Ginn
|
Well I have it fixed guess I wasn't holding my head just right when pasting the example in. Because on the 500th paste of the example it worked.
|
| Page 1 of 1 | [ 3 posts ] |
| You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum |
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info
Powered by phpBB® Forum Software © phpBB Group