Jquery 使用highstocksJS显示的输出图形错误
使用以下代码时,我已将日期指定为 一月一日等等。。。顺便说一句,输出图显示,它添加了一个额外的月份,标记开始于2月1日,以此类推。因此,图形没有按照指定的指标正确显示。有什么不对劲吗Jquery 使用highstocksJS显示的输出图形错误,jquery,ajax,highcharts,Jquery,Ajax,Highcharts,使用以下代码时,我已将日期指定为 一月一日等等。。。顺便说一句,输出图显示,它添加了一个额外的月份,标记开始于2月1日,以此类推。因此,图形没有按照指定的指标正确显示。有什么不对劲吗 <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <link href="
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../style.css" rel="stylesheet" type="text/css" />
<!-- 1. Add these JavaScript inclusions in the head of your page -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript" src="js/highstocks.js"></script>
<!--[if IE]>
<script type="text/javascript" src="http://papermashup.com/flat/js/excanvas.compiled.js"></script>
<![endif]-->
<!-- 2. Add the JavaScript to initialize the chart on document ready -->
<script type="text/javascript">
var chart1; // globally available
$(document).ready(function() {
chart1 = new Highcharts.Chart({
chart: {
renderTo: 'container',
defaultSeriesType: 'spline',
borderColor:"#cccccc",
borderWidth: 4
},
title: {
text: 'Stock Market Stats'
},
xAxis: {
type:'datetime',
plotBands: [{color: "#E12ACD"}],
category:[]
},
yAxis: {
title: {
}
},
series:
[
{
name:'case1',
data:
[
[Date.UTC(2010, 01, 01), 19],
[Date.UTC(2010, 02, 10), 28],
[Date.UTC(2010, 02, 23), 36],
[Date.UTC(2010, 03, 23), 36],
[Date.UTC(2010, 04, 23), 36],
[Date.UTC(2010, 05, 23), 36]
],
},
{
name: 'case2',
data:
[[Date.UTC(2010, 02, 01), 20],
[Date.UTC(2010, 02, 10), 30],
[Date.UTC(2010, 02, 23), 40],
[Date.UTC(2010, 03, 23), 36],
[Date.UTC(2010, 04, 23), 40],
[Date.UTC(2010, 05, 23), 36]
]}
]
});
});
</script>
</head>
<body>
<div id="container">
<div id="overview" style="width: 980px; height: 450px"></div>
</div>
</body>
</html>
var chart1;//全球可用
$(文档).ready(函数(){
图表1=新的高点图表。图表({
图表:{
renderTo:'容器',
defaultSeriesType:“样条线”,
边框颜色:“#中交”,
边框宽度:4
},
标题:{
文字:“股市统计”
},
xAxis:{
类型:'datetime',
plotBands:[{颜色:#E12ACD}],
类别:[]
},
亚克斯:{
标题:{
}
},
系列:
[
{
姓名:'case1',
数据:
[
[UTC日期(2010年1月1日),19],
[UTC日期(2010年2月10日),28],
[UTC日期(2010年2月23日),36],
[UTC日期(2010年3月23日),36],
[UTC日期(2010年4月23日),36],
[UTC日期(2010年5月23日),36]
],
},
{
名称:“案例2”,
数据:
[[UTC日期(2010年2月1日),20],
[UTC日期(2010年2月10日),30],
[UTC日期(2010年2月23日),40],
[UTC日期(2010年3月23日),36],
[UTC日期(2010年4月23日),40],
[UTC日期(2010年5月23日),36]
]}
]
});
});
如果不查看您的代码,从0开始的月份是否会成为问题?我使用了“UTC(2010,01,01)”格式。。。图中标记的点是2月1日