MrTb123 / flot

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

Feature request: Horizontal bar graphs #59

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I would like to be able to draw bars horizontally instead of vertically.

Original issue reported on code.google.com by mark.by...@gmail.com on 15 Sep 2008 at 12:15

GoogleCodeExporter commented 8 years ago
This is the sort of thing I have in mind:

http://firingsquad.com/hardware/geforce_radeon_directx_10_performance_update/ima
ges/lp1920.gif

Original comment by mark.by...@gmail.com on 16 Sep 2008 at 11:04

GoogleCodeExporter commented 8 years ago
I've previously told people to look for other libraries since horizontal bar 
charts
can be done with HTML + CSS without canvas support. But I think that if this 
can be
put in with a few lines of code, then it's probably OK. I'm thinking along the 
lines
of abstracting things a bit in the code so that one can simply swap the 
coordinates
to get the effect.

Original comment by olau%iol...@gtempaccount.com on 1 Oct 2008 at 8:00

GoogleCodeExporter commented 8 years ago
I am thinking to use flot for doing gantt charts, I'd like so much that flot 
can 
support horizontal bars.

Original comment by rodolfoa...@gmail.com on 16 Feb 2009 at 11:09

GoogleCodeExporter commented 8 years ago
Modifying the code to create horizontal bars was pretty straightforward, so I 
gave it a show. I've attached a 
patch against 0.5 that adds horizontal bars.

To enable them, you set the option horizontal: true in the bars options for a 
series or a plot.

Note that using horizontal bars does not swap the data axes for you. So you 
should probably pass the values 
in with the values reversed.

I have not rigorously tested this code, but it's been working in the few test 
cases I've thrown at it.

Original comment by jbleb...@gmail.com on 28 Feb 2009 at 1:11

Attachments:

GoogleCodeExporter commented 8 years ago
Here's a diff against the trunk HEAD (r137), in case there's interest in 
merging this
into the project.

Also including an example showing that it works.

Although it is possible to make horizontal bar charts using flat CSS, I like 
the idea
of incorporating this feature into flot. It's my de-facto choice for doing 
plots, so
the more feature rich it becomes, the happier I am!

Original comment by jbleb...@gmail.com on 28 Feb 2009 at 9:01

Attachments:

GoogleCodeExporter commented 8 years ago
Updates in 139 break the patch that worked on 137, so here's an update to the 
patch
that works against r139

Original comment by jbleb...@gmail.com on 3 Mar 2009 at 2:34

Attachments:

GoogleCodeExporter commented 8 years ago
I've merged your patch now. I've been thinking about swapping the data points, 
it's
not too difficult to do after the recent changes in input handling, but I'm 
unsure
whether it's actually more confusing than not doing it because everything else 
in
Flot still thinks the vertical axis is y.

Thanks for the patch!

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

GoogleCodeExporter commented 8 years ago
None of the revisions after Horizontal bar patch seem to work with IE, at least 
IE7.

Original comment by nbsm...@gmail.com on 13 Mar 2009 at 5:04

GoogleCodeExporter commented 8 years ago
@nbsmith Can you provide some more detail? I'm actively using flot and testing 
in IE7
without problems. Do you have an example file (HTML+JS only please, no 
server-side
code) which doesn't work in IE&, but works in other browsers?

Original comment by jbleb...@gmail.com on 18 Mar 2009 at 4:56

GoogleCodeExporter commented 8 years ago
This file worked in firefox and chrome but not IE7 when using r147, which I've 
attached as well.  The chart attempts to create a regular vertical bar chart.

Original comment by nbsm...@gmail.com on 18 Mar 2009 at 5:46

Attachments:

GoogleCodeExporter commented 8 years ago
I just pulled this up in IE7 and it worked.

I used the flot version that you attached, jquery 1.3.2, and excanvas.min.js 
from SVN
r147.

Running IE 7.0.5730.13 on Windows XP SP2

Original comment by jbleb...@gmail.com on 18 Mar 2009 at 6:21

GoogleCodeExporter commented 8 years ago
Looks like I needed a newer version of excanvas.

Original comment by nbsm...@gmail.com on 18 Mar 2009 at 6:34

GoogleCodeExporter commented 8 years ago
Great, glad it was a simple fix! :-)

Original comment by jbleb...@gmail.com on 18 Mar 2009 at 6:44

GoogleCodeExporter commented 8 years ago
Same here.  It was preventing me from being able to use the horizontal graph.  
I 
retrospect I should have known to download the newest revision of excanvas 
instead of 
using the one that came with the trunk version of flot.

Original comment by nbsm...@gmail.com on 18 Mar 2009 at 6:57