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

Get help using Construct 2

Post » Tue Nov 03, 2015 9:30 pm

Hey @korbaach, I have another question here. It's about sub-bars. I'm curious, how would I go about creating three thinner sub-bars for/beside each month's bar, and based on what number you type into the new/extra textbox, it will effect one the three sub-bars beside the corresponding month's bar?
Last edited by guannstar on Wed Nov 04, 2015 7:10 am, edited 1 time in total.
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Tue Nov 03, 2015 9:44 pm

I'm pretty sure I'll need two new textbox's actually rather than one. One to type in the sub-bar tag-name, and then another one to type in and specify a number amount.
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Wed Nov 04, 2015 9:27 am

I have a different idea...
how about one new button to toggle between "Bar Mode" and "subBar Mode"
(boolean instance variable for Textbox: subBar_Mode-false)
and another button(3 instance) to "Activate" specific subBar...(similar to mothButtons and Bars)
so..if Textbox is set "subBar_Mode-false" you add Textbox value to Bars...
if Textbox is set "subBar_Mode-True" you add Textbox value to subBars....
and you don't need new Textbox(or two)...

Image

What do you think ?
Image
B
64
S
23
G
7
Posts: 1,482
Reputation: 10,825

Post » Wed Nov 04, 2015 4:06 pm

Hey @korbaach! Wow, yeah. It looks great but, where's the month bars? I only see the three sub-bars for each month, but not the main month bars. Also, again, can I use/dl the capx to learn from (like I said before, I have a lot easier time learning the code, by playing around with the code... that way, I could change things and see the effects of what I do immediately).
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Thu Nov 05, 2015 10:13 am

Image
B
64
S
23
G
7
Posts: 1,482
Reputation: 10,825

Post » Thu Nov 05, 2015 4:27 pm

Hey @korbaach! Yeah, thanks soo much. It's exactly what I envisioned. I've really learned a lot from you. Thanks again for all the help!
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Fri Nov 06, 2015 6:14 am

Hey @korbaach! I've been working with you capx (I made a slide effect so that the buttons/menu/texbox are on the left and graph is on the left), but I still have a couple of problems:

First off, on 'on start of layout', the 'TextYear' text shows, but the 'mimicTextYear' text behind it doesn't seem to act as a shadow until you click the up or down button. Second, when you press the 'BtnMode', the frames on the 'BtnSubBar' button all show the initial frame of 3-3-3, instead of 1-2-3. Lastly, when you press the 'BtnSubBar' buttons, the 'SUBbAR' object doesn't show up at all.

Can you help me with this capx?
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Sun Nov 08, 2015 6:44 pm

Hey @korbaach. I sent you a smaller version of the capx (I sent it to you in a PM). It's less than 100 lines and it now has 4 layers. Can I get some help with it, please?
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Mon Nov 09, 2015 12:00 am

Please @korbaach lol, I really need your help man. I just need to figure out these last few things.
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

Post » Fri Dec 04, 2015 6:10 am

Hey @korbaach, could you help me out? I have a little problem.

The 'bar' only goes up to a certain height. It's scaled properly, but how can I change the max height that it goes up to?
Image

Can you show me with this capx? https://dl.dropboxusercontent.com/u/541 ... ample.capx

Thanks man.
B
28
S
5
G
1
Posts: 594
Reputation: 3,286

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: georeb, part12studios, Yahoo [Bot] and 10 guests