2016-05-21 6 views
2

jqplotにダニの棒の合計を表示する方法。私は、下の画像に示すように、そのバーの上に合計として各月の値を表示したいと思います。グループチャートをjqplotに表示

enter image description here

すべてのヘルプシオマネキhttp://jsfiddle.net/bywfc5xx/1/

`var s1 = [200, 600, 700, 1000]; 
var s2 = [460, 210, 690, 820]; 
var s3 = [260, 440, 320, 200]; 
// Can specify a custom tick Array. 
// Ticks should match up one for each y value (category) in the series. 
var ticks = ['May', 'June', 'July', 'August'];` 

を開始してください。

答えて

3

私が使用してuはそこに合計を持って、やろうとしているのか理解していない:

var total = [s1[0] + s2[0] + s3[0], s1[1] + s2[1] + s3[1], s1[2] + s2[2] + s3[2], s1[3] + s2[3] + s3[3]]; 

var plot1 = $.jqplot('chart1', [s1, s2, s3, total], {.. 

実装: http://jsfiddle.net/e4zasp6L/

[OK]を、それを得た、ここで更新答えは次のとおりです。 http://jsfiddle.net/282tkr12/

series:[ 
     { 
       label:'Total', 
       color: 'blue' , 
       renderer: $.jqplot.BarRenderer, 
       rendererOptions: { 
        barWidth:80, 
        shadowAlpha: 0, 
        barPadding: -86, 
       } 
      }, 
      {label:'Hotel'}, 
      {label:'Event Registration'}, 
      {label:'Airfare'}     
     ] 
+0

あなたがFでその合計緑を表示することができます青いバーは、その目盛り – veshu

+0

の下でそのシリーズの合計でなければなりませんイメージのようにそれぞれのチックの幅を鈍らせてください。 – veshu

+0

@veshu check updated答え。 – SilentTremor

関連する問題