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

  • 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!)

  • 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?

  • 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

    I just added another boolean variable for bar sprite("myInput")

    ....and one more layer to ArrayData(12,11,2)...

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

  • 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.

  • 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()")

    How do I separate the year from the day, month and time?

    gRAPhHBaR_FinAl.capx

  • Hey Okay, I understand now (a lot more than I did two days ago). So again, thanks for everything. I've really learned a lot from you!

  • Hey korbaach, I'm not messaging because of something new lol. I figured everything out (thanks again by the way), there's just one small thing... It's the "markerYear" object. When I push the up button ("btnList" object), the "markerYear" object is visible (like it should be), but, when I push the down button ("btnList"), it either goes invisible, or maybe, it's sticking to 2015 (which is the first year on the list now instead of 2010... I switched it). Do you know what the problem might be? I don't get it... I followed your steps, the two "btnList" buttons are actually one object, just like in your example, I also set the "markerYear" image point to 0, 0. So, I don't know if it's a "markerYear" problem or a problem with the "btnList" object...

    When pushed up (it is visible):

    When pushed down (it either goes invisible, or it may be sticking to 2015 (which is the first year instead of 2010... I switched it)):

  • ... it seems like it's ("markerYear" object) sticking to/following year 2015 for some reason (unless you actually click on the year... then it shows up... but it doesn't follow the years as you click on the up/down button).

  • ... it seems like it's ("markerYear" object) sticking to/following year 2015 for some reason...

    This is the reason:

    so.."markerYear" object.... mark only "operating" year (variable "Year")

    if you are doing data entry for 2015..it will mark only 2015

    ..if you dont have 2015 on screen...it will disappear...and will appear again...when the variable "Year" shows..

    If you do not like this ..just disable

    or...you can also add one more frame for "markerYear" sprite

  • Thanks korbaach, again:)... I just disabled it like you said. It works well.

  • Hey korbaach, HAPPY HALLOWEEN! Could I ask you something? How could I make it so that it shows a yearly total number/text (not a total bar, but just the number/text) which adds up the sum of all the months for each year? It's the only thing I'm missing:(

    If you deleted the an example, here: https://dl.dropboxusercontent.com/u/541 ... 6%20(Final).capx

  • Thanks guannstar !

    try this way:

    Add new variable............... "YearTotal"

    add new text object ..........."TextTotal"

    add Function...

    call function when you touch AddButton...and on "update"

  • Hey korbaach! I'm having a little trouble trying to figure out where to actually insert the two sets of code. Can you please show me where to insert the code, using the example capx above?

  • try this one: gRAPhHBaR_tOtAL.capx

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Hey, Thanks a lot man!

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)