Labels for X and Y axis #121

Closed
dnschnur opened this Issue Sep 28, 2012 · 45 comments

Comments

Projects
None yet
7 participants
Owner

dnschnur commented Sep 28, 2012

Original author: koneru.chowdary (June 03, 2008 09:55:46)

is there any way for displaying labels for X axis and Y axis?

Original issue: http://code.google.com/p/flot/issues/detail?id=42

Owner

dnschnur commented Sep 28, 2012

From ryan.fun...@gmail.com on August 12, 2008 16:52:11
If you look at my flot fork (github.com/thenduks/flot) there is rudimentary/early
support for axis labels. Right now x and y both work in firefox 3, and x works
everywhere (I think :)). There's still some issues with the yaxis for browsers other
than firefox 3.

Owner

dnschnur commented Sep 28, 2012

From olau%iol...@gtempaccount.com on October 01, 2008 08:06:33
This is mostly pending on the ability to display rotated text. There was a thread on
the mailing list about it some months ago. I think it's possible with enough hacking,
but is separate enough that I think that the hacking should be done in another
library which Flot can then use.

Owner

dnschnur commented Sep 28, 2012

From olau%iol...@gtempaccount.com on March 23, 2009 18:15:01
This keeps coming up, the latest discussion is here for reference:

http://groups.google.com/group/flot-graphs/browse_thread/thread/3e2585758c4f0e6e/d9aa96a2909a4f00

Owner

dnschnur commented Sep 28, 2012

From Oystein.Stromme@gmail.com on September 09, 2009 06:21:57
jqplot have support for this, maybe this can be ported here?
http://www.jqplot.com/tests/axisLabelTests.php

Owner

dnschnur commented Sep 28, 2012

From sidnei.b...@gmail.com on September 24, 2009 13:35:18
This is not an Enhancement. This is a pre-requisite to any chart. Could you modify
the ticket priority?

Owner

dnschnur commented Sep 28, 2012

From dans...@gmail.com on October 16, 2009 15:41:39
Any updates yet on this feature being implemented?

Owner

dnschnur commented Sep 28, 2012

From olau%iol...@gtempaccount.com on October 21, 2009 15:39:47
Oystein: yeah. Canvas text support is beginning to emerge in the browsers. If I'm not
mistaken, support for it got added to excanvas some time ago. If someone would cook
up a patch and smoketest it in various browsers, it would certainly speed up the process.

sidnei, danshao: It'll appear faster if you help.

Owner

dnschnur commented Sep 28, 2012

From eaton....@gmail.com on January 13, 2010 19:13:32
It doesn't have to be rotated - horizontal text would be good enough.

Owner

dnschnur commented Sep 28, 2012

From substant...@gmail.com on March 09, 2010 18:23:54
Why on earth is this only "medium" priority? A plot without axis labels is useless.

Owner

dnschnur commented Sep 28, 2012

From dans...@gmail.com on March 10, 2010 21:03:13
Why is this only an "enhancement"? Sounds like a bug to me.

Owner

dnschnur commented Sep 28, 2012

From prodan.c...@gmail.com on April 29, 2010 05:32:40
I also believe the priority of this should be higher ...

Owner

dnschnur commented Sep 28, 2012

From getAlexD...@gmail.com on June 10, 2010 17:15:06
I echo the higher-priority sentiment already expressed on this issue .. not that I think I have the skills to do anything better than a sort-of-works-sometimes hack...

Owner

dnschnur commented Sep 28, 2012

From don.airo...@gmail.com on July 26, 2010 08:28:40
got any updates on this? I wish to use months on the x-axis label.

Owner

dnschnur commented Sep 28, 2012

From mbo...@gmail.com on July 29, 2010 10:47:26
I also think this issue should have higher priority. A plot without axis labels is like measurement data without uncertainty, you don't know what you are looking at.

Owner

dnschnur commented Sep 28, 2012

From mimec...@gmail.com on July 29, 2010 12:24:33
Not that I don't want to see nice axis labels - Flot is doing the plotting, but you have all kinds of tools from jQuery and plain html/css to create your labels yourself... It sure would be a nice enhancement, but hardly a bug.

Owner

dnschnur commented Sep 28, 2012

From thatn...@gmail.com on August 03, 2010 19:11:51
@mimecine: this is true, but in terms of ease-of-use and code prettiness, it totally makes sense to me to have axis labels taken care of inside flot. I may switch to jqplot for just this reason.
higher-priority-plz +1

Owner

dnschnur commented Sep 28, 2012

From GT516.U...@gmail.com on August 31, 2010 03:42:19
I find a simple way to add axes is to make a 3x3 table (with zeroed out borders) and put the graph in the middle cell. That gives you the surrounding cells to make any sort of labels, titles, or explanatory text, and closely link them to the graph. (And it makes it easy to position the graph on a page.) Sure, it would be nice to have something within flot for axes, but for the moment I find that a tables works fine.

Owner

dnschnur commented Sep 28, 2012

From lisa.h...@excelscient.com on August 31, 2010 11:21:35
I would really like to use Flot, but without easy-to use axes labels I will have to use something else. There is limited use to a graph plotting tool, which requires a separate tool to control axes labels.

My vote is to raise the priority on this one...

Owner

dnschnur commented Sep 28, 2012

From xuan....@engineering.ucla.edu on September 04, 2010 08:02:33
I just started a plugin for axis labels. It currently only supports X and Y axis (not X2 or Y2). It supports both types: canvas text or HTML text

http://github.com/xuanluo/flot-axislabels

Owner

dnschnur commented Sep 28, 2012

From rui.pereira on March 31, 2011 11:13:52
Hi. I created a plugin that allows axis labels by replacing one of the extreme (visible min/max) tick label by the axis label. It works for multiple axes and has the advantage of not having to mess around with plot sizes and fancy positioning. You can get it at

https://github.com/RuiPereira/flot/raw/axislabels/jquery.flot.axislabels.js

and see a screenshot at

https://github.com/RuiPereira/flot/raw/axislabels/examples/axislabels_flot.png

Owner

dnschnur commented Sep 28, 2012

From lahike...@gmail.com on November 04, 2011 14:00:40
FWIW, Rui Pereira's plugin seems to work pretty well, except it botches the centering of Y labels for me. I used the textAlign property and now it seems better. Unfortunately, the plugin is a bit inefficient, so i hope something gets added to the code soon. My patch attached.

Owner

dnschnur commented Sep 28, 2012

From mathieuc...@gmail.com on January 27, 2012 14:49:26
I can confirm last patch solve some annoying axislabel issues i've had ! thanks man !

Owner

dnschnur commented Sep 28, 2012

From rui.pereira on January 27, 2012 15:01:08
Hi. Just to clarify, it seems that the patch on comment #25 refers to xuanluo (#22) plugin, not mine. The implementations are quite different.

Owner

dnschnur commented Sep 28, 2012

From foglia...@gmail.com on February 04, 2012 21:34:50
The only full implementation of an axis title/label that I found was the one from xuanluo and modification by markrcote (https://github.com/markrcote/flot-axislabels), unfortunately it does not work for the new multiple axes method in the latest flot version (only does the first 2 axes, yaxis and y2axis which does not exist anymore). Anybody else has a full plugin for this issue? A chart without axis title/label, especially with multiple axes (like on a meteogram) can not really be used.

Owner

dnschnur commented Sep 28, 2012

From mrcote on February 16, 2012 22:28:18
I fixed up my plugin (https://github.com/markrcote/flot-axislabels) to support N axes. I've tested it with Firefox, Chrome, Opera, Safari, IE 9, and IE 8. Forcing canvas labels in IE 8 (via axisLabelForceCanvas) does not work at the moment, but the default mode (IE transforms + CSS positioning) does.

Owner

dnschnur commented Sep 28, 2012

From remu...@gmail.com on February 21, 2012 10:34:37
Great plugin! Could you add plot title as well?

Owner

dnschnur commented Sep 28, 2012

From kaesebaron on February 26, 2012 17:44:27
Hi,

thanks for this plugin. Unfortunately I can not get the font-family to be changed. Can someone tell me how to do this? I tried:
yaxis: { axisLabelForceCanvas: true, axisLabel: 'y-Achse', axisLabelFontFamily: 'Arial' }

Owner

dnschnur commented Sep 28, 2012

From mrcote on March 12, 2012 19:31:48
Hm I kind of think that plot title is a bit out of scope of this plug-in and very easily done with regular HTML/CSS. However, I've gotten this request a few times, so I may add support for it at some point.

Owner

dnschnur commented Sep 28, 2012

From mrcote on March 12, 2012 19:53:33
kaesebaron: Sorry, I made a mistake in the README. The option to force canvas is axisLabelUseCanvas, not axisLabelForceCanvas. I committed a fix to the README.

Owner

dnschnur commented Sep 28, 2012

From kaesebaron on March 23, 2012 20:29:02
Thank you.

Owner

dnschnur commented Sep 28, 2012

From tollef.s...@gmail.com on March 31, 2012 16:11:43
Bit of a shame the plugin by marcrcote is GPL. Any chance of changing the license?

Owner

dnschnur commented Sep 28, 2012

From mikeslim7 on April 28, 2012 21:43:30
Hi all, I have added on to Mark's script for support of Flot 1.1 and the updated script can be found at https://github.com/mikeslim7/flot-axislabels. Only 1 change has been done on 2 places in the script so the rest of the functions are as Mark had made them. :-) Mike.

This was referenced Sep 28, 2012

Contributor

markrcote commented Dec 4, 2012

Not sure what flot 1.1 is, since the current version is 0.7 and the next will be 0.8. My axisLabels plug-in still seems to work fine with the latest commits to master.

My plug-in was GPLed because the original author (Xuan Luo) released it under the GPL. However since then he re-released it under MIT, and I did so with my fork as well.

Contributor

markrcote commented Dec 4, 2012

We are also planning to move at least a subset of axis-label support into core at some point, though this may wait until flot 0.9.

This needs to be done, I agree. Axes Labels are a must for any plot

+1 for axis labels.

vizv commented Jun 26, 2013

+1 here

dnschnur was assigned Jun 26, 2013

Owner

dnschnur commented Jun 26, 2013

We're working on this right now, actually, for 0.9. I'll be pushing my work up to 0.9-branch by sometime next week.

vizv commented Jun 26, 2013

👍 That's great! glad to hear that!

ova2 commented Jul 8, 2013

Hi,

Is it already available in the branch? Unfortunately, but label on Y-axis looks ugly with axisLabel plugin in IE8. So, I'm waiting for this feature in the core.

Thanks in advance.

Owner

dnschnur commented Jul 8, 2013

The implementation is done, but it will take a few more days to fix up various cross-browser issues that I've found in testing.

Are you referring to the problem where rotated text is very blurry? I've already fixed that, but there are some limitations; it requires that the text have a solid color background, for example. In the end this will never be perfect on IE7/8, but it should be very close in most cases.

ova2 commented Jul 8, 2013

Hi David,

Yes, the rotated text is very blurry. David, where can I find the fix? I should deliver this chart example with rotated label this week. Can you say please what should be fixed in https://github.com/mikeslim7/flot-axislabels to get rid of blurred text in IE8. Thanks!

ova2 commented Jul 9, 2013

Fixed blurry text in IE8 with zoom:1; background-color:white;

This line in the mentioned above plugin

s += ' filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=' + rotation + '); zoom:1; background-color:white; ';

Owner

dnschnur commented Jul 9, 2013

I will merge into the 0.9-work branch once everything looks good across all browsers. This will in any case be unstable code; it's not something you should base a release on.

mimecine commented Jul 9, 2013

No criticism of Oleg, but whenever I hear deliver I imagine a company with
funding that probably should consider a donation to this project, another
worthy open source project or even a randomly picked humanitarian
organization in return for a free solution...
On Jul 9, 2013 7:56 AM, "David Schnur" notifications@github.com wrote:

I will merge into the 0.9-work branch once everything looks good across
all browsers. This will in any case be unstable code; it's not something
you should base a release on.


Reply to this email directly or view it on GitHubhttps://github.com/flot/flot/issues/121#issuecomment-20669094
.

dnschnur closed this Jul 15, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment