Adarq.org

Introduction Area => News, Announcements, & Suggestions => Topic started by: Dreyth on September 06, 2012, 12:17:39 am

Title: any way to make a chart?
Post by: Dreyth on September 06, 2012, 12:17:39 am
is it possible?

So I've got a food log that looks like this on this site:

Quote
-= Calorie Log =-

FOOD                               CALORIES            PROTEIN            FAT               CARB
5 cups whole milk                 750                     40g                  40g                69g
6 scoops whey protein         720                     144g                 6g                 18g
1 KFC biscuit                         180                     4g                    10g                20g
1 KFC drumstick                    200                     15g                   12g                7g
2 slices of pizza                    540                      26g                   20g               66g
2 shackburgers                    980                      58g                   58g                54g
Total                              +3,370                   287g                146g             234g

BMR: -2,000cal
Walked 6 miles: -600cal
Light shoot around: -100cal
Worked out: -200cal
Thermic effect of food: -300cal
Total: -3,200cal

Balance: +170


Is there anyway to post the whole calroies protein fat carb section in a chart so that everything is nice and perfectly lined up? preferably a choice to use a border or not to.

if there isn't, it'd be a nice addition.
Title: Re: any way to make a chart?
Post by: entropy on September 06, 2012, 12:35:38 am
I use calorieking and then take a screenshot, then upload it to imgurl and post that in my log.

eg

(http://i.imgur.com/8gtWp.png)
Title: Re: any way to make a chart?
Post by: Dreyth on September 06, 2012, 11:32:55 am
i would do that but i do a lot of copying and pasting. some things i have every day or almost every day, like pizza, protein, and milk. plus it would just be nice and concise. also, i edit my log throughout the day after i eat a few times and/or lift.
Title: Re: any way to make a chart?
Post by: Dreyth on March 07, 2013, 10:54:59 am
adarqui, is it possible?
Title: Re: any way to make a chart?
Post by: adarqui on March 07, 2013, 11:21:05 am
adarqui, is it possible?

ya i can do some custom table if you want..

would something like this be acceptable?

http://www.datatables.net/release-datatables/examples/basic_init/zero_config.html

it could have a format like:

Code: [Select]
[chart name="whatever"]
heading1,heading2,heading3,...headingX
value,value,value,...value..
value,value,value,...
[/chart]

or did you mean something else?

with that format you could keep copying your chart and re-posting with new data, and it would be sortable etc..

what you think.
Title: Re: any way to make a chart?
Post by: Dreyth on March 07, 2013, 11:34:29 pm
i mean hey that looks awesome! but really just a standard table would suffice. doesn't even have to show lines or anything... as long as the text can be lined up.

well that would suffice for me, perhaps the other members could make great use of an actual chart like you posted  :headbang:
Title: Re: any way to make a chart?
Post by: Dreyth on March 07, 2013, 11:53:00 pm
basically something analagous to very simply CSS styling would do, with th's and td's
Title: Re: any way to make a chart?
Post by: adarqui on March 08, 2013, 02:55:44 am
i wrote it at work today in a separate php file, but implementing it into smf's bbcode thing was a bitch.

i mean it's pretty "smart" right now, far from optimal though... this project reminds me why i love nodejs so much.. communicating with php on server side vs javascript on client side is so inefficient...

anyway, i'll adjust it and add some features like possibly auto graphing etc.. might be fun.. also add things like auto totaling the columns at the bottom in a separate 'total' row.... ill also add something like title= and shit.

example.. first 'row' is the headings, the others are data.. only rows that much the 'heading count' will get entered into the table.. you can see in the example below that the 'junk' wont make it in:

[dtable]
date,bodyweight,squat,vert,goku
1/1/2013,150,135,25,2
5/1/2013,160,225,30,4
9/1/2013,165,275,33,6
4/2/2013,165,350,36,8
[/dtable]

Code: [Select]
[dtable]
date,bodyweight,squat,vert,goku
1/1/2013,150,135,25,2
5/1/2013,160,225,30,4
9/1/2013,165,275,33,6
4/2/2013,165,350,36,8
[/dtable]





[dtable]
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
3,4,5
1
alert('hh');
9,8,7,6,5,4,3,2,1,0
afs
a
f
s
 
 
 mso msdo
 m
[/dtable]


Code: [Select]
test!

[dtable]
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
3,4,5
1
alert('hh');
9,8,7,6,5,4,3,2,1,0
afs
a
f
s
 
 
 mso msdo
 m
[/dtable]



ooh so much fun:

[dtable]
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
one,two,three,four,five,six,seven
a,b,c,d,e,f,g
1,2,3,4,5,6,7
2,3,4,5,6,7,8
[/dtable]
Title: Re: any way to make a chart?
Post by: vag on March 08, 2013, 05:45:37 am
+500!!!
Title: Re: any way to make a chart?
Post by: adarqui on March 08, 2013, 09:06:29 am
+500!!!

:D

glad u likes.
Title: Re: any way to make a chart?
Post by: Dreyth on March 08, 2013, 12:32:12 pm
That shit is awesome!!!

maybe you should add some kind of cell alignment or a way to set the table width. also row/text color. gotta make it look pretty  :lololol:
Title: Re: any way to make a chart?
Post by: adarqui on March 08, 2013, 12:50:56 pm
That shit is awesome!!!

maybe you should add some kind of cell alignment or a way to set the table width. also row/text color. gotta make it look pretty  :lololol:

coo!

ya i want like

[dtable name=".." width="1-100%" color="..." align="{center,left,right}" ...

also, in cells, i want the ability to like, if you put _tot_ , _avg_, _max_, _min_, it'd figure that out based on the column data above it or the row data to the left... ie, if you have:

blah,1,2,3,tot <- tot cell would be 6

if you have

blah,1,2,3
blax,2,3,4
tota,tot,tot,tot

then it'd be

blah 1,2,3
blax 2,3,4
tota 3,5,7

etc..

i have a few big projects before i recode the entire forum... once i recode the forum tho it's going to be 2050 status. beastcity.

;d
Title: Re: any way to make a chart?
Post by: Dreyth on March 08, 2013, 12:57:18 pm
me so essited