devanshukumar / flot

Automatically exported from code.google.com/p/flot
0 stars 0 forks source link

Support for stacked bars. #31

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It seems that it is not possible to create a graph with stacked bars. Like
this one: http://www.fusioncharts.com/free/Images/GalleryIcons/5/4.gif

It would be nice if it could! Thank you for considering this.

Original issue reported on code.google.com by ojacq...@gmail.com on 12 Apr 2008 at 2:59

GoogleCodeExporter commented 8 years ago
yes please! And stacked area graphs - I is possible to do with a bit of messing 
with
the data but not ideal

Original comment by rox.solo...@gmail.com on 21 May 2008 at 10:52

GoogleCodeExporter commented 8 years ago
I also would like this feature. As a workaround, instead of [x1,x2,x3], I plot
[x1+x2+x3, x1+x2, x1]. This creates the illusion of stack graphs by drawing the 
bars
on top of each other.

There are a few problems with this workaround though. For example, if you use
transparent colours for the bars then the colour of the topmost bar will be 
mixed
with the colors of the bars beneath it. The resulting colour of the bar won't 
match
the legend.

It looks difficult to create a small patch to add the stacked bar feature in a 
clean way.

Original comment by mark.by...@gmail.com on 15 Sep 2008 at 2:37

GoogleCodeExporter commented 8 years ago
Here's an idea. Extend the bar support so you can specify a secondary y 
coordinate 
(like [x, y, y2]) which is the lower edge of the bar. This would default to 0.

With this in place, I think you could emulate the stacked bar charts perfectly 
by 
preprocessing the data. This sounds relatively straight-forward to implement, 
the 
biggest task is probably that someone needs to sit down and test how it looks 
like 
with real data. If anyone of you is up for this, I'll be happy to review a 
patch.

Next step is to figure out whether preprocessing support should be in Flot or 
not. I 
think that depends on the circumstances. If it can be made intuitive and small 
both 
code-wise and API-wise, my general opinion is that it's OK to put in.

Original comment by olau%iol...@gtempaccount.com on 18 Sep 2008 at 9:32

GoogleCodeExporter commented 8 years ago
If you can support stacked bar i think it is a first step to support candle 
stick
graph: http://www.mathworks.com/matlabcentral/files/3549/candle.jpg 
example:   
 max    
  _|_
c|   |
 |   |
o|___|
   |
  min 

You could create another graph option 'candles' and the input will be like
[[x,c,o,max,min],...]
x->date time. c->close . o->open -> max-> maximum value and min-> minimum value.
So you just draw a stacked bar and a vertical line to do the candle.

Original comment by rickoren...@gmail.com on 4 Oct 2008 at 1:24

GoogleCodeExporter commented 8 years ago
Here my patch and demo for stacked bars, I used it for my company products. It 
worked
well with mouseover tooltips too.

Original comment by waruichi...@gmail.com on 2 Nov 2008 at 4:12

Attachments:

GoogleCodeExporter commented 8 years ago
waruichingu: Sorry for not getting back earlier, I've been caught up in another
project with a hard deadline this Monday. I had a very brief look at your patch 
now,
and I don't think I agree on the details but the general idea is interesting so 
I'll
give it a spin.

Original comment by olau%iol...@gtempaccount.com on 18 Nov 2008 at 1:24

GoogleCodeExporter commented 8 years ago
No, worry mate.

Cheers,
waruichingu

Original comment by waruichi...@gmail.com on 24 Nov 2008 at 10:05

GoogleCodeExporter commented 8 years ago
Hi waruichingu:

I tried your sample for stack graph but it was throught out errors. it would be 
great if you can send  the updated jquery.flot.js and a sample.

Thanks in Advance.
Surender k

Original comment by surender...@gmail.com on 19 Jan 2009 at 7:36

GoogleCodeExporter commented 8 years ago
I just closed issue 81 by adding support for specifying a third coordinate to 
bars.
So now it's just a question of preprocessing which should be simpler with the 
recent
input handling changes.

Original comment by olau%iol...@gtempaccount.com on 8 Mar 2009 at 10:34

GoogleCodeExporter commented 8 years ago
The third-coordinate approach could be useful for creating <a
href="http://zoonek2.free.fr/UNIX/48_R/g206.png">bubble plots</a> as well.

Original comment by jbleb...@gmail.com on 10 Mar 2009 at 6:42

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I've been working with the stacked bars all day.  It works great with Firefox 
but
there seems to be some issue with IE 

http://www.4theweb.co.uk/test/resultstest.htm

Original comment by calen...@slipperyhill.co.uk on 25 Mar 2009 at 10:16

GoogleCodeExporter commented 8 years ago
I am having a problem using the patch.diff file.  Could you please update your 
patch 
so it works with the current version of jquery.flot.js?

Original comment by reeve...@hotmail.com on 7 Apr 2009 at 6:14

GoogleCodeExporter commented 8 years ago
I'd like to see this feature for line graphs, so that filled areas may be 
stacked.

Original comment by bla...@bravo5.org on 19 May 2009 at 1:45

GoogleCodeExporter commented 8 years ago
candle stick graph (work only vertical    horizontal so strange)

http://chujoii.googlepages.com/jquery.flot.js
example:
http://chujoii.googlepages.com/graph-types3.html

md5sum:
af99b9148df26d18949c677e21ef93f4  jquery.flot.js
5e12189796580d7988dadce28442ece5  examples/graph-types3.html

-- 
Roman V. Prikhodchenko (aka chujoii)

Original comment by chuj...@gmail.com on 24 May 2009 at 4:27

Attachments:

GoogleCodeExporter commented 8 years ago
new version "candle stick graph" (based on svn-version 2009-05-25)

http://chujoii.googlepages.com/jquery.flot.js
http://chujoii.googlepages.com/graph-types3.html

4c558dfe259b67b162dd5ccc134e16dc  jquery.flot.js
5beb56a97dabaa4b0144aee5bb221bba  examples/graph-types3.html

-- 
Roman V. Prikhodchenko (aka chujoii)

Original comment by chuj...@gmail.com on 25 May 2009 at 5:34

Attachments:

GoogleCodeExporter commented 8 years ago
Does the candle stick graph flot support the stacked graphs?  If so does it 
work with
a second y cord, or do you just tell it that they are stacked?

Original comment by findar...@gmail.com on 18 Jun 2009 at 4:09

GoogleCodeExporter commented 8 years ago
This isn't about stacked bars, but rather stacked line graphs, but I didn't know
where else to put this.

I modified the jquery.flot.stack.js plugin to essentially stack in reverse 
order,
giving the ability to use fills on stacked line graphs without everything being
covered over.

See the attached html for an example.

Original comment by the.d...@gmail.com on 23 Jun 2009 at 10:32

Attachments:

GoogleCodeExporter commented 8 years ago
Oops, I only included the minified copy above, here's the original:

Original comment by the.d...@gmail.com on 23 Jun 2009 at 10:38

Attachments:

GoogleCodeExporter commented 8 years ago
Support for stacked horizontal bars would be great. If I want to turn the bar 
chart
horizontal, I need to switch the data points (x -> y, y -> x), but after that 
the
stacked bar doesn't work since the y axis values get accumulated.

Original comment by antti.ko...@gmail.com on 17 Jul 2009 at 10:17

GoogleCodeExporter commented 8 years ago
tried your Patch...I think it doesn't fix the issue :
Given X1,X2,X3,...Xn  Flot fails to draw in the order

1: X1+...Xn, 
2: X1+...xn-1, 
...
n : X1

On my screen (didn't look into the code), it looks like your mod is drawing in 
this
order which is still not what we expect:
1 : X1 + .. + Xn   (ok)
2 : X2+ ..  +Xn   bad
3 : x3+... +Xn
...
2: xn-1+xn
1: xn 

of course, there is a way to make it work, by sending xn,...x1 to flot (i.e. in
reverse order) and (maybee) reversing the legend...but reversing things is not 
the
way to go, that is still not the optimal __Simple__ solution.

I'm not good enough in javascript to fix that. But it would be nice to have 
working
fill lines with the correct legend....
Can someone fix that ?

Original comment by olivier....@free.fr on 7 Aug 2009 at 7:01

GoogleCodeExporter commented 8 years ago
With the stack plugin, I'm not sure this bug (stacked bars) is relevant anymore 
so
I'm going to close it. As for filled line areas, I've just committed support 
for that
too, based on code from Roman.

Original comment by olau%iol...@gtempaccount.com on 7 Dec 2009 at 3:32

GoogleCodeExporter commented 8 years ago
Has anyone managed to fix the IE8 bug?

Original comment by matthewb...@gmail.com on 7 Jun 2010 at 7:29

GoogleCodeExporter commented 8 years ago
What IE8 bug?

Original comment by gregory.auger on 11 Aug 2011 at 7:26

GoogleCodeExporter commented 8 years ago
Any plans to support horizontal stacked bars ?

Original comment by pio...@gmail.com on 11 Nov 2011 at 3:12

GoogleCodeExporter commented 8 years ago
please help!
I use a plug-in flott! has achieved all can not only true test set up x-axis! 
You can create one so that if he built a chart on the job only points with a 
uniform step and did not increase the distances between two points if their 
values ​​such as 3 8 10 15? I need it for a site to build a date with an 
equal step

Original comment by ellad...@gmail.com on 21 Nov 2011 at 1:40

GoogleCodeExporter commented 8 years ago
On IE8 this lib breaks. Any pointers how we can fix that. 

Original comment by bhushang...@gmail.com on 14 Feb 2014 at 4:01