On Thursday 13 Mar 2003 11:07 am, Adam Reynolds wrote:
> Currently I have gridlines set to 5.
>
> So on a scale range of 20 - 80 you get 5 markes, effectively the quartile
> positions at:
> 20, 35, 50, 65, 80
> What I ultimately want is not to do it this way I want to determine the
> scale and set it to
> 20, 30, 40, 50, 60, 70, 80
I've just come against the same problem - the default appears to be to draw 8
or so lines, and with a range of 0-17 this results in non int. values on the
axis.
So we want a function that does
gridlines = numGridLines(minData,maxData,interval)
and then set
scaleFrom=nearest(minData,interval,'lower')
scaleTo=nearest(maxData,interval,'higher')
Easy one first:
nearest(value,interval,type)
if value/interval != int(value/interval) //not on a point
tmp=value/interval
if type == lower
tmp=int(tmp)
elsif type=higher
tmp=ceiling(tmp)
tmp=tmp*interval
return tmp
elsif
return value
not as hard as you thought one:
numGridLines(min,max,interval)
min=nearest(min,interval,'lower')
max=nearest(max,interval,'higher')
return (max-min)/interval
I'm implementing these in our pages now. Probably not worth adding to cflib.
--
Tom C
"Land of the free, home of the brave... you have to be brave to live there and
enjoy the freedoms"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4