JqPlot不显示任何内容
JqPlot not displaying anything
我有一个简单的web应用程序,在eclipse的src文件夹中没有任何东西,我在eclipse的Webcontent文件夹中维护了一个NEwfile.html。我有"插件"文件夹下的webcontent存储我的javascript文件。
这是我的HTML代码
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org /TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<div id="chat3" style="height:400px;width:300px; "></div>
<script type="text/javascript" src="plugins/jquery.js"></script>
<script type="text/javascript" src="plugins/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.pointLabels.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
var s1 = [2, 6, 7, 10];
var s2 = [7, 5, 3, 4];
var s3 = [14, 9, 3, 8];
plot3 = $.jqplot('chart3', [s1, s2, s3], {
// Tell the plot to stack the bars.
stackSeries: true,
captureRightClick: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Put a 30 pixel margin between bars.
barMargin: 30,
// Highlight bars when mouse button pressed.
// Disables default highlighting on mouse over.
highlightMouseDown: true
},
pointLabels: {show: true}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
},
yaxis: {
padMin: 0
}
},
legend: {
show: true,
location: 'e',
placement: 'outside'
}
});
// Bind a listener to the "jqplotDataClick" event. Here, simply change
// the text of the info3 element to show what series and ponit were
// clicked along with the data for that point.
$('#chart3').bind('jqplotDataClick',
function (ev, seriesIndex, pointIndex, data) {
$('#info3').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
}
);
});
</script>
</body>
</html>
你做的一切都是正确的,除了你应该参考jquery 1.9或以上版本和jqplot.css这是一个很好的例子
http://jsfiddle.net/K2dLA/<script src="~/Scripts/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="plugins/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.barRenderer.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="plugins/jqplot.pointLabels.min.js"></script>
<link href="plugins/jqplot/jquery.jqplot.css" rel="stylesheet" />
<div id="chat3" style="height:400px;width:300px; "></div>
$(document).ready(function(){
var s1 = [2, 6, 7, 10];
var s2 = [7, 5, 3, 4];
var s3 = [14, 9, 3, 8];
plot3 = $.jqplot('chat3', [s1, s2, s3], {
// Tell the plot to stack the bars.
stackSeries: true,
captureRightClick: true,
seriesDefaults:{
renderer:$.jqplot.BarRenderer,
rendererOptions: {
// Put a 30 pixel margin between bars.
barMargin: 30,
// Highlight bars when mouse button pressed.
// Disables default highlighting on mouse over.
highlightMouseDown: true
},
pointLabels: {show: true}
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer
},
yaxis: {
padMin: 0
}
},
legend: {
show: true,
location: 'e',
placement: 'outside'
}
});
// Bind a listener to the "jqplotDataClick" event. Here, simply change
// the text of the info3 element to show what series and ponit were
// clicked along with the data for that point.
$('#chart3').bind('jqplotDataClick',
function (ev, seriesIndex, pointIndex, data) {
$('#info3').html('series: '+seriesIndex+', point: '+pointIndex+', data: '+data);
}
);
});
change
<div id="plot3" style="height:400px;width:300px; "></div>
<div id="chart3" style="height:400px;width:300px; "></div>
相关文章:
- 是否有任何内置方法可以更改JavaScript对象'的属性设置为某个值
- 如何使用 html 类或 id 在任何地方显示内容
- 使用JavaScript(可能是CSS)在HTML5画布内显示特定宽度/高度的完整图像大小(100%宽度/高度)
- 使用 CasperJS 时,是否可以在执行任何内联或外部 Javascript 之前与加载页面的 DOM 进行交互
- 更改文件字段内显示的路径的位置
- 在将图像上传到服务器之前在画布内显示图像
- 在
标签内显示产品名称
- 输入类型“文本”的 ng-init 不会在文本框内显示任何数据
- DHTML - 在有限的时间内显示图片
- 仅在特定区域内显示图像
- 在高图表的 tspan 标签内显示图像
- 使用 javascript 获取仅在日期范围内显示的数据
- 在固定大小的块内显示具有圆角的任意大小的图像
- 循环 JS 变量不会在函数内显示正确的值
- 在酒窝气泡图中的每个气泡内显示标签
- 需要我使用 NodeJS 在页面内显示 OpenLayers 3 映射
- 如何使用离子和角度在模态内显示选定的图像名称
- 使用javascript在if条件内显示链接
- 找不到“”;应用程序“;模板或视图.对象{fullName:“template:application”}将不呈现任何内
- AngulasJS、OnsenUI、Phonegap、警报在控制器内显示两次