gmmoraesbr / flot

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

Option to specify a single y axis on the right side of the plot #352

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
For design reasons I need to have a single y axis on the right side of the plot.

Specifying y2axis and omitting yaxis in the plot options works somewhat, but 
that results in the tick 
lines being drawn as 10 pixel marks on the right axis, instead of lines 
spanning the width of the plot.

I can work around the latter problem by patching jQuery.flot.js but that is not 
an ideal solution.
I include my edits to jQuery.flot.js (version 0.6) below to illustrate what I'm 
doing:

at line 1189 I added this line:
var y2TicksFullWidth = (axis.ticks.length == 0);

and lines 1215 and 1216 (formerly 1214 and 1215) become:
ctx.moveTo(y2TicksFullWidth ? 0 : plotWidth - 5, Math.floor(axis.p2c(v)) + 
ctx.lineWidth / 2);
ctx.lineTo(y2TicksFullWidth ? plotWidth : plotWidth + 5, 
Math.floor(axis.p2c(v)) + ctx.lineWidth / 2);

Original issue reported on code.google.com by markchag...@gmail.com on 18 May 2010 at 9:11

GoogleCodeExporter commented 8 years ago
Sorry, this should have been reported as an enhancement, but I can't find a way 
to change the setting.
Mark

Original comment by markchag...@gmail.com on 18 May 2010 at 9:13

GoogleCodeExporter commented 8 years ago
I'm happy to report that this has been revamped in the development version 
which you can get here

http://flot.googlecode.com/svn/trunk/

Original comment by olau%iol...@gtempaccount.com on 13 Dec 2010 at 4:37