嗨我有一個js文件,它使用ajax從php腳本中獲取XML文檔。 XML文件形成數據以繪製Fusion Chart。我知道我正在獲取XML數據,但FusionCharts不會繪製它。我真的很感激任何幫助,感謝使用XML數據填充FusionCharts AJAX
(FusionCharts.js is included earlier in my script)
if(XMLHttpRequestObject) {
XMLHttpRequestObject.open("GET", "chart.php?job="+job, true);
XMLHttpRequestObject.onreadystatechange = function() {
if (XMLHttpRequestObject.readyState == 4 && XMLHttpRequestObject.status == 200) {
var xdoc = XMLHttpRequestObject.responseXML;
var chart1 = new FusionCharts("Pie3D.swf", "chart1Id", "400", "300", "0", "1");
chart1.setDataXML(xdoc);
chart1.render("chart1div");
chart.php產生XML數據
<chart caption='ADI Chart Test ' >
<set label='Driver' value='12.25' />
<set label='Other Staff' value='223.21' />
<set label='Equipment' value='0.00' />
<set label='Additional Items' value='0.00' />
<set label='Vehicle Fuel' value='0.00' />
<set label='Accomodation' value='0.00' />
<set label='Generator Fuel' value='0.00' />
</chart>