2013-08-06 4 views
1
[[["09251A0428",90],["10251A0547",37]],[["09251A0428",4],["10251A0547",54]]] 

위의 데이터에는 2 개의 시리즈가 포함되어 있습니다. 각 시리즈의 x 값은 같습니다. x 값이 숫자 인 경우 jqplot은 두 개의 계열이있는 선형 차트를 표시합니다. x 축에 문자열을 표시하고 해당 문자열에 해당하는 계열 값을 표시해야합니다.Jqplot 꺾은 선형 차트 여러 시리즈

jqplot의 여러 계열 선 차트에 대해 xaxis에 문자열을 설정하는 방법은 무엇입니까? 당신은 당신이 준 데이터를 기반에 대한

답변

1

내가 예를 preapared 한 : JsFiddle link

$.jqplot.config.enablePlugins = true; 
var chartData = [[["09251A0428",90],["10251A0547",37]],[["09251A0428",4],["10251A0547",54]]]; 


function PlotChart(chartData) { 

    var plot2 = $.jqplot('chart1', chartData, { 
     title: 'Mouse Cursor Tracking', 
     seriesDefaults: { 

      pointLabels: { 
       show: true 
      } 
     }, 
     axes: { 
      xaxis: { 
       pad: 1, 
       // a factor multiplied by the data range on the axis to give the    
       renderer: $.jqplot.CategoryAxisRenderer, 
       // renderer to use to draw the axis,  
       tickOptions: { 
        formatString: '%b %#d' 
       } 
      }, 
      yaxis: { 

      } 
     }, 
     highlighter: { 
      sizeAdjust: 7.5 
     }, 
     cursor: { 
      show: true 
     } 
    }); 
} 

PlotChart(chartData); 
+0

덕분에, 그것은 렌더러'가능합니다 : $ .jqplot.CategoryAxisRenderer' – user2463026