2014-02-14 2 views
0

jquery jqplot 플러그인을 사용하고 있습니다. tickInterval 설정에 관한 문제가 있습니다. 10시 01 분, 10시 2 분, 10시 03 분, ..., 11시 59 분과 같이 1 분 차이로 10시에서 12시 사이에 X 축 값을 표시하고 싶습니다. 이 목적으로이 코드를 작성했습니다.jqplot xaxis tickInterval (분 또는 초)

var data = [['10:55', 578.55], ['11:02', 566.5], ['11:04', 480.88], ['11:08', 509.84], 
         ['11:12', 454.13], ['11:22', 379.75], ['11:33', 303], ['11:39', 308.56], 
         ['11:41', 299.14], ['11:52', 346.51], ['11:54', 325.99], ['11:56', 386.15]]; 
     var plot1 = $.jqplot('chart1', [data], { 
      title: 'Average Response Time Graphic - Last One Hour By Minute', 
      axes: { 
       labelRenderer: $.jqplot.CanvasAxisLabelRenderer, 
       labelOptions:{ 
        fontFamily:'Helvetica', 
        fontSize: '14pt' 
       }, 
       xaxis: { 
        label : "Time", 
        renderer: $.jqplot.DateAxisRenderer, 
        tickRenderer: $.jqplot.CanvasAxisTickRenderer, 
        <!--tickOptions:{formatString:'%d.%m.%y %H:%M:%S', angle: -30},--> 
        tickOptions: { 
         formatString:'%H:%M:%S', 
         angle: -30, 
         tickInterval : '1 minute' 
         <!--tickInterval : '60000' --> 
        }, 

        <!--min: '2013-02-05 10:50', --> 
        min: '10:00', 
        max: '12:00' 
       }, 
       yaxis: { 
        label: "Average Response Time", 
        tickOptions: { 
         formatString: '$%.2f' 
        } 
       } 
      }, 
      highlighter: { 
       show: true, 
       sizeAdjust: 7.5 
      }, 
      cursor: { 
       show: false 
      } 
     }); 

그러나 10시와 12시 사이의 x 축 값 사이에 10 분 차이가 있기 때문에이 코드는 잘 작동하지 않습니다. 그건 그렇고, 나는 자바 스크립트의 잘못된 평가가 발생하지 않도록 모든 jqplot 플러그인 파일을 추가했습니다.

나는이 문제를 jqPlot DateAxis tickInterval not working에서 살펴 보았지만 첫 번째 대답을 시도했지만 나쁘지 않았습니다.

이 문제를 해결하는 데 도움을 줄 수있는 사람이 있습니까? 미리 감사드립니다.

감사합니다.

답변

0

해결책을 찾았습니다! tickOptions에서 tickInterval을 제거하고 xaxis 아래에두면 효과가 있습니다!