HTML, JS 및 CSS와 함께 jqplot 라이브러리를 사용하여 ios xcode에서 piechart를 만들려고합니다. xcode 시뮬레이터에서 주요 HTML 페이지의 경고 만 표시하면 출력을 얻을 수 없습니다. chrome borwser에서 html 파일을 실행하는 동안 결과는 얻지 못하지만 html 파일과 다른 모든 javascript 파일에 대한 모든 경고를 얻을 수 있습니다.ios xcode에서 파이 차트 생성 문제 html css 및 js와 함께 jqplot 사용
다음과 같이 사용되는 HTML의 코드는 다음과 같습니다
Devicepiechart.html :
<!DOCTYPE html>
<html lang="en">
<Head>
<title>Testing plots functions</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" href="jquery.jqplot.css" />
<!-- BEGIN: load jquery -->
<script language="javascript" type="text/javascript" src="jquery-2.0.3.min.js"></script>
<script>
function load()
{alert("loading HTML scripts!");}
</script>
<script language="javascript" type="text/javascript" src="jquery.jqplot.min.js"></script>
<script language="javascript" type="text/javascript" src="jqplot.pieRenderer.min.js"></script>
<!-- END: load jqplot -->
</head>
<body onload= "load()">
<div id="pie" style="margin-top:-15px; margin-left:-15px; width:335px; height:445px;"> </div> </body> </html>
그리고 프로젝트 내 다운로드 포함 된 다른 CSS와 JS 파일의 코드는 devicepiechart.js 파일을
$(document).ready(function(){
var data = [
['Heavy Industry', 12],['Retail', 9], ['Light Industry', 14],
['Out of home', 16],['Commuting', 7], ['Orientation', 9]
];
var plot1 = jQuery.jqplot ('chart1', [data],
{
seriesDefaults: {
// Make this a pie chart.
renderer: jQuery.jqplot.PieRenderer,
rendererOptions: {
// Put data labels on the pie slices.
// By default, labels show the percentage of the slice.
showDataLabels: true
}
},
legend: { show:true, location: 'e' }
}
);
});
다른 모든 js 및 css 파일은 같은 폴더에 포함됩니다. xcode 및 브라우저에서도 piechart를 만들 수 있습니다. 미리 감사드립니다.