本文介绍了jqplot xaxis刻度未渲染的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用以下代码生成jqplot.

I am using the below code to generate 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
                    }
                }
            });

但是,它不会生成x轴刻度(即日期).Yticks很好.

However, it is not generating the xaxis ticks (i.e., dates).Yticks are coming fine.

下面是我包含的脚本.

<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" />

我以前曾提出过类似的问题,但是我没有任何答案.

I have previously raised similar question, but I have not got any answers.

有人可以尽快提出建议吗?

can somebody plss advise as soon as possible ???

推荐答案

我通过查看您脚本的路径来解决这个问题,这些路径似乎有些杂乱无章.因此,我说您没有找到dateAxisRenderer插件,该插件默认位于库所在的jqplot dist文件夹下的plugins文件夹下.

I am quessing by looking at your scripts' paths, which appear to be a bit disorganised, that them are the problem. Therefore, I say that you are not finding the dateAxisRenderer plugin which by default is under the plugins folder which is under jqplot dist folder in which the library comes.

否则,请构建一个jsfiddle.我建议您使用答案中显示的示例,因为您无需编辑脚本,只需输入您的代码,看看是否有效.

Otherwise please build a jsfiddle. I would sugest you to use the sample shown in my answer, since there you do not need to edit scripts and just enter your codes and see if it works.

这篇关于jqplot xaxis刻度未渲染的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-11 19:02