Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/409.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何更改我的轴标签在jqplot中的位置_Javascript_Jquery_Jqplot - Fatal编程技术网

Javascript 如何更改我的轴标签在jqplot中的位置

Javascript 如何更改我的轴标签在jqplot中的位置,javascript,jquery,jqplot,Javascript,Jquery,Jqplot,我的y轴上有一些标签如下所示: yaxis: { label: 'Phases', ticks: [[1," "],[2,'Step 1'],[3,'Step 2'],[4,'Step 3'],[5,'Step 4'],[6,'Step 5'],[7,'Step 6']] } 但是,我希望通过记号标记来定位它们(我已经画了一个箭头,显示了我要定位它们的位置)。有可能改变我的标签吗?或

我的y轴上有一些标签如下所示:

yaxis: {                      
    label: 'Phases',                 

    ticks: [[1," "],[2,'Step 1'],[3,'Step 2'],[4,'Step 3'],[5,'Step 4'],[6,'Step 5'],[7,'Step 6']]
       }

但是,我希望通过记号标记来定位它们(我已经画了一个箭头,显示了我要定位它们的位置)。有可能改变我的标签吗?或者只是改变我的记号的位置来匹配标签

以下是我的javascript:

$(document).ready(function () {

    var yticks = ['Step 1', 'Step 2', 'Step 3', 'Step 4', 'Step 5', 'Step 6'];

    //some asp calls to my c# code to get points
    var customers = <%=getCustomersForLineGraph()%>;
    var points = <%=getMainLineGraphPoints()%>;

    var plot3 = $.jqplot('linegraph', points,
      {
          title: 'All Companies Completion Status',

          axes: {
              xaxis: {
                  renderer: $.jqplot.DateAxisRenderer,
                  label: 'Work Weeks',
                  max: 55,
                  min: 0,
                  tickOptions: {
                      formatString: '%.0f',
                  },
              },
              yaxis: {

                  label: 'Phases',
                  renderer: $.jqplot.CategoryAxisRenderer,
                  labelRenderer: $.jqplot.CanvasAxisLabelRenderer,

                  ticks: yticks
              }
          },
      }
    );

});

我想我会把这个问题留给别人,以防其他人遇到类似的问题(如果这不是正确的协议,请让我知道)。谢谢

当我将渲染器更改为$.jqplot.DateAxisRenderer并用数字替换标签时,它排列正确。我还尝试过使用:“labelRenderer:$.jqplot.AxisLabelRenderer”和“tickRenderer:$.jqplot.AxisTickRenderer”,但没有任何运气