I'm trying to create a piechart in my ios xcode using jqplot library along with HTML,JS and CSS. In xcode simulator I can't get any output just the alert of main HTML page is just displaying. While running the html file in chrome borwser, result is not obtained, but could get all the alerts of html file and all other javascript files.
The code of html used is as follows:
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>
And the code of other css and js files are downloaded and included inside the project, the devicepiechart.js file is as follows:
$(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' }
}
);
});
All other js and css file are included within the same folder. Can any one help me to create piechart in xcode and also in the browser. Thanks in advance.