Wont my data points be misaligned, then?
E.g., the tick will be at 5.5 but read as 5; people might wonder why a data point that is 5 would show up below the "5" tick mark.
Sort of the same problem you see with dates on the y axis - the tick is labeled with a date, but a data point with that date will be completely misaligned by ~30 pixels. It just looks bad. And disengenuous.
> --
> You received this message because you are subscribed to the Google Groups "jqplot-users" group.
> To post to this group, send email to jqplot...@googlegroups.com.
> To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/jqplot-users?hl=en.
>
The automatic tick generation algorithm is not optimal and should generate more "round" numbers. This in and of itself is not too difficult. It becomes very complex when you need to allow users to override any combination of axes min, max, tick interval, or number of ticks. The simplistic algorithm used in pre 1.0 versions to allow flexibility will be improved in later versions.
--
Chris Leonello
jqplot...@jqplot.com
> --
> You received this message because you are subscribed to the Google Groups "jqplot-users" group.
> To post to this group, send email to jqplot...@googlegroups.com.
> To unsubscribe from this group, send email to jqplot-users...@googlegroups.com.
The format string only formats the display of a number, it does not change the actual value. That is, if a tick is at 23.456 with a format string of "%d", it will display as 23 on the plot but will still be positioned at 23.456. This may be what you are seeing.
stats = [[2000,55],[2001,44],[2002,84],[2003,70],[2004,99],[2005,37],[2006,18],[2007,14],[2008,17],[2009,32],[2010,15]];
plot = $.jqplot('chartdiv',[stats],
{
xaxis:{tickOptions:{formatString: '%d'}, min:2000, max:2011},
yaxis:{tickOptions:{formatString: '%d'}, min:0, max:100},
title:'Doping usage since 2000',
series:[{color:'#5FAB78'}]
});
The code above gives the following output: