Javascript JQPlot插件大小
在这段代码中,我使用的是我从这个站点获取的jqplot插件。我想要的是改变高度和宽度的大小。如何做到这一点 我的代码:Javascript JQPlot插件大小,javascript,jquery,plugins,Javascript,Jquery,Plugins,在这段代码中,我使用的是我从这个站点获取的jqplot插件。我想要的是改变高度和宽度的大小。如何做到这一点 我的代码: <!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title>JQPlot</title> <script src="h
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<title>JQPlot</title>
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
<script type="text/javascript" src="js/jquery.jqplot.min.js"></script>
<script type="text/javascript" src="js/jqplot.highlighter.min.js"></script>
<script type="text/javascript" src="js/jqplot.cursor.min.js"></script>
<script type="text/javascript" src="js/jqplot.dateAxisRenderer.min.js"></script>
</head>
<body>
<div id="chart1" style="width:600px; height:250px;"></div>
<script type="text/javascript">
$(document).ready(function () {
var line1 = [['23-May-08', 578.55], ['20-Jun-08', 566.5], ['25-Jul-08', 480.88], ['22-Aug-08', 509.84],
['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 308.56],
['23-Jan-09', 299.14], ['20-Feb-09', 346.51], ['20-Mar-09', 325.99], ['24-Apr-09', 386.15]];
var line2 = [['23-May-08', 323], ['20-Jun-08', 222], ['25-Jul-08', 123], ['22-Aug-08', 43],
['26-Sep-08', 454.13], ['24-Oct-08', 379.75], ['21-Nov-08', 303], ['26-Dec-08', 544],
['23-Jan-09', 654], ['20-Feb-09', 234], ['20-Mar-09', 543], ['24-Apr-09', 323]];
var plot1 = $.jqplot('chart1', [line1, line2], {
title: 'Data Point Highlighting',
axes: {
xaxis: {
renderer: $.jqplot.DateAxisRenderer,
tickOptions: {
formatString: '%b %#d'
}
},
yaxis: {
tickOptions: {
formatString: '$%.2f'
}
}
},
highlighter: {
show: true,
sizeAdjust: 300
},
cursor: {
show: false
}
});
});
</script>
</body>
</html>
JQPlot
$(文档).ready(函数(){
变量行1=['08年5月23日',578.55],'08年6月20日',566.5],'08年7月25日',480.88],'08年8月22日',509.84],
[08年9月26日,454.13],[08年10月24日,379.75],[08年11月21日,303],[08年12月26日,308.56],
[09年1月23日,299.14],[09年2月20日,346.51],[09年3月20日,325.99],[09年4月24日,386.15];
变量行2=['08年5月23日',323],'08年6月20日',222],'08年7月25日',123],'08年8月22日',43],
[08年9月26日,454.13],[08年10月24日,379.75],[08年11月21日,303],[08年12月26日,544],
[09年1月23日、654年”、“09年2月20日”、“234年”、“09年3月20日”、“543年”、“09年4月24日”、“323年];
变量plot1=$.jqplot('chart1',[line1,line2]{
标题:“数据点突出显示”,
轴线:{
xaxis:{
渲染器:$.jqplot.DateAxisRenderer,
选择:{
格式字符串:'%b%#d'
}
},
亚克斯:{
选择:{
formatString:“$%.2f”
}
}
},
荧光灯:{
秀:没错,
尺寸:300
},
光标:{
节目:假
}
});
});
需要为容器div本身指定宽度和高度。
查看示例的源代码
需要为容器div本身指定宽度和高度。
查看示例的源代码
需要为容器div本身指定宽度和高度。
查看示例的源代码
需要为容器div本身指定宽度和高度。
查看示例的源代码
绘制的绘图大小取决于容器的尺寸DIV
,只需更改宽度和高度的CSS
(而不是600px和250px)
绘制的绘图大小取决于容器的尺寸
DIV
,只需更改宽度和高度的CSS
(而不是600px和250px)
绘制的绘图大小取决于容器的尺寸
DIV
,只需更改宽度和高度的CSS
(而不是600px和250px)
绘制的绘图大小取决于容器的尺寸
DIV
,只需更改宽度和高度的CSS
(而不是600px和250px)
<div id="chart1" style="width:600px; height:250px;"></div>