Jump to content

[SOLVED] "Viewing range" for table from data set... (statistics, or calculus?)


5kyy8lu3

Recommended Posts

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.

Link to comment
Share on other sites

 

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.