0

我的折线图使用了 jqplot,也许我会使用更多的 yaxis。因此,使用 yaxis 和 y2axis,水平网格线可以很好地显示在图表上。但如果我使用 y3axis 或 y4axis,则没有水平网格线。我猜可能 jqplot 不支持这样做,或者它可能是一个错误。

看看这里:

var tfsGraphNodes= [[1,4],[2,2],[3,21],[4,61],[5,71],[6,10]];

jQuery.jqplot('chart1', [tfsGraphNodes], {
 title: 'Applicant Behaviour', 
    series: [{color: 'green',label: 'Applicant Trend', yaxis: "y4axis"}],   
 legend: {show: true}, 
 highlighter: {showTooltip: true}, 
 axes: {
  xaxis: {
   tickOptions: {formatString: '%d'},
   //Comment or un-comment to see what happens on xaxis's ticks
   tickInterval: 1
  },

     y4axis: {
         tickOptions: {
             showGridline: true
         }
     }
 }
});

我当前的 jqplot 版本是:2007.04.27

那么,你能告诉我处理这个问题的方法吗?我很感激任何解决方案

4

1 回答 1

0

好的,伙计们,以前没有人遇到过像我一样的问题,所以我自己解决了。目前的jqplot不支持这样做,所以要让它工作,我们需要修改jqplot的js源。

在 jqplot 源码中。我们会看到一些地方定义了 y(n) 轴,我们只需在其中添加我们想要的数字 yaxis 并修改循环以使其合适。我这样做了,对我来说效果很好。

于 2013-09-06T11:08:08.833 回答