我试图实现这个示例http://www.jqplot.com/examples/date-axes.php#chart2
这是我的代码
$script="var line1=[['2008-06-30 8:00AM',4], ['2008-7-14 8:00AM',6.5], ['2008-7-28 8:00AM',5.7], ['2008-8-11 8:00AM',9], ['2008-8-25 8:00AM',8.2]];";
$script .= "$.jqplot('chart_periodi', [line1]";$script .= ", {
legend:{show:true},
title:'Aperture/ora nel tempo, da inizio a fine ciclo newsletter',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%b %#d, %#I %p'},
min:'June 16, 2008 8:00AM',
tickInterval:'2 weeks'
}
},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
highlighter: {sizeAdjust: 7.5},
grid: {background:'#f3f3f3', gridLineColor:'#accf9b'},
})";
echo $script;
$objResponse->script($script);
echo
显示了这一点
var line1=[['2008-06-30 8:00AM',4], ['2008-7-14 8:00AM',6.5], ['2008-7-28 8:00AM',5.7], ['2008-8-11 8:00AM',9], ['2008-8-25 8:00AM',8.2]];$.jqplot('chart_periodi', [line1], {
legend:{show:true},
title:'Aperture/ora nel tempo, da inizio a fine ciclo newsletter',
axes:{
xaxis:{
renderer:$.jqplot.DateAxisRenderer,
tickOptions:{formatString:'%b %#d, %#I %p'},
min:'June 16, 2008 8:00AM',
tickInterval:'2 weeks'
}
},
series:[{lineWidth:4, markerOptions:{style:'square'}}]
highlighter: {sizeAdjust: 7.5},
grid: {background:'#f3f3f3', gridLineColor:'#accf9b'},
})
我不明白问题出在哪里。我没有错误,但没有可见的情节。谢谢
您添加了需要调整标点符号的选项。尝试在"系列"行的末尾添加一个逗号,并删除"网格"行末尾的逗号。