user1732217
user1732217

Reputation: 67

Flot stacked chart bar width like line chart

I tried to make flot stacked chart to input data in array x1,x2,x3... and y1,y2,y3...

My line chart data is made like that so I duplicated its js and did some changes but the width of bar still same as line chart. Any advise?

http://jsfiddle.net/TXPWK/67/

Upvotes: 0

Views: 2063

Answers (1)

p_strand
p_strand

Reputation: 597

The problem is barWidth: 0.4. Since you are using Dates on the xaxis, the numeric values between x1, x2, x3 and so on, will be relatively large values. If you wish the bars to be significantly wider than the axis lines, you would have to set barWidth to something like:

 barWidth:1000 * 60 * 60 * 24 * 15 //Half month: 1000 ms * 60 sec *60 min * 24 hour * 15 days

I have created a fork from your jsfiddle example where I have modified the barWidth:

http://jsfiddle.net/6TaQt/1

Upvotes: 4

Related Questions