gpt4 book ai didi

jquery - jqplot折线图中的错误

转载 作者:行者123 更新时间:2023-12-01 04:08:38 25 4
gpt4 key购买 nike

我有这段代码。我不知道为什么图表没有显示。正如控制台显示它正在绘制,但我无法显示它。我相信我已经添加了容器,但不知道哪里出了问题。控制台没有显示任何错误。

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-

1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>




</head>
<body>

<div data-role="tabs">
<div data-role="navbar">
<ul>
<li><a href="#one" data-theme="a" data-ajax="false">Price Grid</a></li>
<li><a href="#two" data-theme="a" data-ajax="false">Price Chart</a></li>

</ul>
</div>


<div id="one" class="ui-content">

<style>
table,th,td
{
border:1px solid black;

}
th
{
background-color:green;
color:white;
}
</style>



<table id="myTable">


</table>



</div>

<div id="two" style="height:400px;width:300px; "></div>

<script language="javascript" type="text/javascript" src="../js/jqplot/jquery.min.js">

</script>
<script language="javascript" type="text/javascript"
src="../js/jqplot/jquery.jqplot.min.js"></script>

<link rel="stylesheet" type="text/css" href="../js/jqplot/jquery.jqplot.css" />

<script type="text/javascript">

$(function(){

$.jqplot('two', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);

});
</script>



</div>




</body>
</html>

最佳答案

首先包括该死的框架,当jqplot链接不正确时,你期望它如何工作。第二组 display: block !important; 到您的 div 容器 #two

工作示例:

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css">
<script src="http://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
</head>
<body>

<div data-role="tabs">
<div data-role="navbar">
<ul>
<li><a href="#one" data-theme="a" data-ajax="false">Price Grid</a></li>
<li><a href="#two" data-theme="a" data-ajax="false">Price Chart</a></li>

</ul>
</div>

<div id="one" class="ui-content">

<style>
table,th,td
{
border:1px solid black;

}
th
{
background-color:green;
color:white;
}

#two {
height:400px;
width:300px;
display: block !important;
}
</style>



<table id="myTable">


</table>



</div>

<div id="two" style=""></div>

<script language="javascript" type="text/javascript" src="http://www.jqplot.com/src/jquery.min.js"></script>
<script language="javascript" type="text/javascript" src="http://www.jqplot.com/src/jquery.jqplot.min.js"></script>
<link rel="stylesheet" type="text/css" href="http://www.jqplot.com/src/jquery.jqplot.min.css" />

<script type="text/javascript">

$(function(){

$.jqplot('two', [[[1, 2],[3,5.12],[5,13.1],[7,33.6],[9,85.9],[11,219.9]]]);

});
</script>



</div>




</body>
</html>

关于jquery - jqplot折线图中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23891442/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com