2010-10-19 102 views
0

大家好我是鈦(iphone)的新手我正在開發PieChart我想在我的代碼中使用HTML如何使用..目前我已經編碼像這樣但它的顯示空白頁可以任何人都可以提前告訴我如何做到這一點。在鈦應用程序中呈現HTML

這裏是代碼

var divTag = document.createElement('div'); 
divTag.id = "graph"; 
divTag.innerHTML = "Loading graph"; 
document.body.appendChild(divTag); */ 



var myData = new Array(['Communicate socially', 42], ['Engage in work for classes', 38], ['Be entertained', 10], ['Communicate professionally', 7], 

['Not sure/Don\'t know', 2]); 
    var colors = ['#C40000', '#750303', '#F9ECA2', '#FA9000', '#FA5400']; 
    var myChart = new JSChart('graph', 'pie'); 
    myChart.setDataArray(myData); 
    myChart.colorizePie(colors); 
    myChart.setTitle('Students use the Internet most often to (%)'); 
    myChart.setTitleColor('#8E8E8E'); 
    myChart.setTitleFontSize(11); 
    myChart.setTextPaddingTop(30); 
    myChart.setSize(616, 321); 
    myChart.setPiePosition(308, 170); 
    myChart.setPieRadius(85); 
    myChart.setPieUnitsColor('#555'); 
    myChart.setBackgroundImage('chart_bg.jpg'); 
    myChart.draw(); 

回答

1
var divTag = document.createElement('div'); 
divTag.id = "graph"; 
divTag.innerHTML = "Loading graph"; 
document.body.appendChild(divTag); /* remove */