2012-09-21 2 views
1

동적으로 차트를 그리고 싶습니다. 은 사용자가 선택에 의존합니다. 아래에 그에 대한 스크린 샷입니다 .. 제가 12.00에서 시간의 시작에 뭔가 라인이 ..jqplot 꺾은 선형 차트에서 차트를 분 단위로 설정/그리는 방법은 무엇입니까?

var plot2 = $.jqplot(div, mainArray, { 
          title:chartValue[1], 
          seriesDefaults: { 
           lineWidth:1, 
           markerOptions: { show:true, size:3 }, 
           rendererOptions: { 
            smooth: true 
           } 
          }, 
          axesDefaults: { 
           labelOptions:{textColor:'#313233', fontSize:'11px',fontWeight:'Bold', fontFamily:'Arial'} 
          }, 
          axes:{ 
           xaxis:{ 
            renderer: $.jqplot.DateAxisRenderer, 
            rendererOptions:{ 
             tickRenderer: $.jqplot.CanvasAxisTickRenderer, 
             tickInset:0 
            }, 
            //tickRenderer:$.jqplot.CanvasAxisTickRenderer, 
            tickOptions:{ 
             autoscale:true, 
             fontSize:'10px', 
             fontFamily:'Arial', 
             angle:-90, 
             formatString: dFormat 
            }, 
            //min: minDate, 
            //max: maxDate, 
            tickInterval:timeInterval 
           }, 
           yaxis:{ 
            min: 0, 
            max: maxV.length > 1 ? parseInt(maxV) + ((parseInt(maxV)/10)): parseInt(maxV)+2, 
            tickOptions: { 
             formatString: '%d', 
             fontSize:'10px', 
             fontFamily:'Arial', 
             showGridline: true, 
             showLabel: true 
            }, 
            base: Math.E, 
            forceTickAt0: true 
           } 
          }, 

          legend: { 
           show: true, 
           labels: legendNames, 
           //placement: 'outsideGrid' 
           renderer:$.jqplot.EnhancedLegendRenderer, 
           location: 'ne',  // compass direction, nw, n, ne, e, se, s, sw, w. 
           xoffset: 10,  // pixel offset of the legend box from the x (or x2) axis. 
           yoffset: 10  // pixel offset of the legend box from the y (or y2) axis. 
          }, 

          cursor:{ 
           show:true, 
           style:'auto', 
           followMouse:true, 
           zoom:true, 
           looseZoom:true, 
           showTooltip:false 
          } 

         }); 

을하고있는이에 enter image description here

. 하지만 나는 그것을 데이터에 가깝게 원한다. 그게 가능한가?

참고 :

mainArray = data 
dFormat = string format for date time 

답변

1

나는 당신이 당신이 xaxis에서 주석 한 min 속성을 설정할 필요가 있다고 생각합니다.

mainArray의 형식에 따라 mainArray[0][0][0] 또는 mainArray[0][0]으로 첫 번째 날짜 값을 가져올 수 있습니다. 또는 변수 minDate을 설정/전달해야 할 수 있습니다.

관련 문제