eliot
unread,Feb 7, 2008, 11:54:35 AM2/7/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to plotkit
This is a patch that allows you to specify a function to determine how
a label should be displayed.
I'm using right now for date/time graphs and its working very well.
example usage : layout.xTickLabeler = function(z){ return new
Date(z); };
@@ -584,7 +584,10 @@
PlotKit.Layout.prototype._evaluateLineTicksForXAxis = function()
{
var pos = this.xscale * (xvalues[i] -
this.minxval);
if ((pos > 1.0) || (pos <
0.0))
continue;
- this.xticks.push([pos,
xvalues[i]]);
+ var temp =
xvalues[i];
+ if
( this.xTickLabeler )
+ temp =
this.xTickLabeler( temp );
+ this.xticks.push([pos,
temp ]);
tickCount+
+;
}
if (tickCount >
this.options.xNumberOfTicks)