使用jqplot和html css和js在ios xcode上创建饼图的问题
Issue with Piechart creation on ios xcode using jqplot with html css and js
我正试图使用jqplot库以及HTML、JS和CSS在我的ios xcode中创建一个piechart。在xcode模拟器中,我无法获得任何输出——只有主HTML页面的警报正在显示。在chrome borwser中运行html文件时,没有得到结果,但可以得到html文件和所有其他javascript文件的所有警报。
使用的html代码如下:
Devicepiechat.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文件的代码被下载并包含在项目中,devicepiecht.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吗。提前谢谢。
只需将所有.js文件加载到项目Targets的"buildid phases"的"copy bundle resources"中,现在piechat就可以在ios模拟器中成功运行了。
相关文章:
- 使用导航属性创建Kendo UI网格模型的问题
- 从数组在d3中创建条形图时出现问题
- Knockout映射创建/更新出现问题
- 创建服务器控件.创建问题
- 标签的rggraph问题Above未出现在第二个图形创建中
- 在我的网站上创建一个在1-10之间不断变化的数字时遇到了问题.Javascript
- 创建jQuery对象时出现问题
- InnerHTML创建问题,没有't加载顺序正确,可能存在处理问题
- 新对象创建问题
- jquery 查询字符串创建问题
- D3 分组条形图创建问题
- jQueryMobile的页面创建问题很有趣
- AngularJS LocalForage CRUD创建问题
- Node.JS对象创建问题“;用户不是一个函数”;
- Braintree支付方式在node.js中创建问题
- 如何使用Node.JS在JIRA上创建问题
- Jquery函数调用/创建问题
- 在windows 10中使用mkdirp文件夹创建问题
- Javascript原型-对象创建问题
- 切克框单击创建问题