我使用以下代码生成jqplot。
var data = [["25 August 2002", 299.75],["02 September 2002", 1511.22],["02 October 2002", 1967.00],["01 November 2002", 2335.80],["02 December 2002", 2008.15],["02 January 2003", 4579.52],["02 February 2003", 5253.98],["07 March 2003", 5491.12],["01 April 2003", 8937.26],["08 May 2003", 16520.95],["01 June 2003", 13725.03],["01 July 2003", 22800.12],["11 August 2003", 34828.20],["01 September 2003", 48176.53],["01 October 2003", 57216.98],["01 November 2003", 45644.96],["01 December 2003", 50927.94],["01 January 2004", 51279.52],["01 February 2004", 41711.34],["01 March 2004", 49790.00],["01 April 2004", 49686.61],["01 May 2004", 40634.78],["22 August 2004", 16889.98],["01 September 2004", 41684.68],["29 June 2006", 151.55],["25 March 2008", 469.75],["17 July 2008", 159.90],["04 August 2008", 719.55],["11 December 2009", 94.00],["01 December 2010", 449.95],["01 April 2011", 449.95],["01 June 2012", 4529.40]];
var plot1 = $.jqplot('DealerResp', [data],
{
axes: {
yaxis: {
label: 'Subs. Revenue',
tickOptions: {
formatString: 'R%.2f'
},
min: 0
},
xaxis: {
label: 'Period',
renderer: $.jqplot.DateAxisRenderer,
tickOptions: {
formatString: '%b-%Y'
},
pad: 0
}
}
});
但是,它没有生成xaxis刻度(即日期)。 Yticks很好。
以下是我所包含的脚本。
<script src="/javascript/jquerylib/jquery-ui-1.8.13.custom.min.js"></script>
<script type="text/javascript" src="/javascript/jquerylib/jqplot.dateAxisRenderer.min.js"></script>
<script src="/javascript/support/compositerpt.js"></script>
<script type="text/javascript" src="/javascript/jquerylib/jqplot/jquery-1.6.1.jqplot-1.0.0b2_r792.min.js"></script>
<script src="/javascript/jquerylib/tablesorter/jquery.tablesorter.min.js"></script>
<link rel="stylesheet" type="text/css" href="/CSS/jqplot/jquery-1.6.1.jqplot-1.0.0b2_r792.min.css" />
<link href="/CSS/less/stealth.less" rel="stylesheet" type="text/css" />
我之前提出了类似的问题,但我没有得到任何答案。
有人可以尽快提出建议吗?答案 0 :(得分:0)
我正在通过查看脚本的路径来查询,这些路径看起来有点混乱,它们就是问题所在。因此,我说您没有找到默认位于dateAxisRenderer
文件夹下的plugins
插件,该文件夹位于库所在的jqplot dist
文件夹下。
否则请建立一个jsfiddle。我希望您使用the sample shown in my answer,因为您不需要编辑脚本,只需输入您的代码并查看它是否有效。