5kyy8lu3 Posted February 18, 2009 Share Posted February 18, 2009 Hi. I'm working on some new home-made php graphs for my site but I'd like the table to adjust the 'viewing range' depending on the minimum and maximum values in the data set. I've tried lots of things and even after 4 hours of brainstorming I can't come up with a solution. I'm pretty sure it's going to end up being something I should know but at the moment I don't know how to tackle this hurdle. I basically want my graph to show only the 'meat' of the data. If my lowest percent is 30% and the top percent is 70%, i don't want the white space from 0-30% and 70-100% showing so only the middle stuff is visible. i want to be able to set a 'maximum length' for the graph's bars. lets say my lowest number is 3 and the max is 8, i want 3 to show up at the bottom of the graph and 8 at the top. I basically want the 3 to be 0% of the max length and i want the 8 to be 100% of the max length. if this doesn't make sense i uploaded a mock up graph to show you what i mean http://www.kloudz.com/graph.jpg sorry for the crude paintbrush picture lol I'm guessing i'll either need to use some statistics formula or possibly calculus. Any help is greatly appreciated, thanks ahead of time. Quote Link to comment Share on other sites More sharing options...
5kyy8lu3 Posted February 19, 2009 Author Share Posted February 19, 2009 ok well i think i found a solution, and it's embarrassingly simple. i just shift the entire data set down by the value of the minimum in the set to set the 'base' to zero. then i graph it. now to come up with how to set the 'max length' to where it's always just enough to fit the max numbers in teh data set. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.