How do I create a bar graph based on textbox inputs?

Get help using Construct 2

Post » Sat Oct 17, 2015 4:09 pm

Lol, I have to admit... I kind of thought you did forget; but OMG, thank you so much! You have been such a great help. I understand how you created the twelve month buttons now. I can't say it enough man, thanks again. You're the best!

P.S. I checked out you're artwork. It's very interesting... dark yes, but very interesting! I personally like "Hiding Inside Myself" and "Desperation". They remind me of Dali pieces.
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Sun Oct 18, 2015 3:12 am

Hey @korbaach. I followed your instructions and set it up and my app. I did it correctly, but there's still one slight problem. For some reason, when I set it all up, the bar and number above it keep floating away from the clamped spot on the chart. Can you tell me? Why is this happening?

Image
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Sun Oct 18, 2015 12:26 pm

from what I can see from the picture..you probably did not put bar origin image point on bottom..

Image

If I'm wrong, please upload simple capx...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Oct 18, 2015 4:52 pm

Hey @korbaach, yeah, you were right about the image point. I fixed the bar clamp problem, but there are still few little things I need to fix.

For instance:
1. the text linked to the bar is still offset (it keeps floating a bit to the right)
Image

2. when I slide my page/layout (I use a slide function in my app) to get to the chart, the year text in the list keeps shrinking.
(Before Sliding)
Image
(After Sliding)
Image

[sidenote:] Also, I was wondering, how can I put a space area between each bar, rather than having them pressed up right against each other?
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Sun Oct 18, 2015 6:30 pm

guannstar wrote:1. the text linked to the bar is still offset (it keeps floating a bit to the right)

the same problem as with bar sprite..click on text object and set
Image

2. when I slide my page/layout (I use a slide function in my app) to get to the chart, the year text in the list keeps shrinking.


try this..click on list object..set
Image

Also, I was wondering, how can I put a space area between each bar...


in example i use bar sprite (h=250px;w=22px)...so in code
Image
if you replace 22 with 30..you'll have a 8px space between each bar...
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Sun Oct 18, 2015 7:40 pm

Hey @korbaach, as always, everything you said worked! Once again, thanks a lot. While I was finishing though, I thought of something else. Would it be possible (because the bar is one object) to let the user click on each separate month bar, and leave a message in a textbox that appears?

Thanks again (I can't believe how much I've learned from you in such a short period of time!)
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Sun Oct 18, 2015 7:46 pm

Oh yeah @korbaach, I forgot to ask before. What line of code specifies how many pixels/big the bar will be when the number 1 is entered into the textbox?
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Sun Oct 18, 2015 10:13 pm

guannstar wrote: Would it be possible (because the bar is one object) to let the user click on each separate month bar, and leave a message in a textbox that appears?


very possible.. :)

check this capx .......... gRAPhHBaR_6.capx

Image

I just added another boolean variable for bar sprite("myInput")
....and one more layer to ArrayData(12,11,2)... :)

What line of code specifies how many pixels/big the bar will be when the number 1 is entered into the textbox


Image
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Mon Oct 19, 2015 1:18 am

OMG @korbaach, this is sooooooo amazing. Holy crap, thanks so much. One more thing... really.... I think lol. Could I make it so that every time you click on the textbox, within it, it shows the date and time (so when you write down your mothly messages, you know what date and time it was when you wrote them)? Again thanks so much man.
B
36
S
9
G
1
Posts: 629
Reputation: 3,956

Post » Mon Oct 19, 2015 1:20 pm

guannstar wrote: One more thing... really....
Could I make it so that every time you click on the textbox, within it, it shows the date and time (so when you write down your mothly messages, you know what date and time it was when you wrote them)?


of course... just use Browser.ExecJS("Date()") :D
How do I separate the year from the day, month and time?

Image


gRAPhHBaR_FinAl.capx
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests