Background color line graph widget

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
Summertime01
Posts: 11
Joined: Thu Aug 23, 2018 2:14 pm

Background color line graph widget

Post by Summertime01 » Mon Oct 08, 2018 11:37 am

Hi all,

I would like to change the background color of a line graph widget. If I've seen correctly for other widgets, there is no such "background color" or "opaque" property yet. Is there a way of changing the background for a line graph?

Thanks for your ideas.

Klaus
Posts: 10394
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Background color line graph widget

Post by Klaus » Mon Oct 08, 2018 12:40 pm

Hi Summertime01,

if the inspector does not supply a setting for this, then there is no setting for this. But it is not forbidden to put an opaque graphic behind your widget, the user won't tell the difference! 8)


Best

Klaus

Summertime01
Posts: 11
Joined: Thu Aug 23, 2018 2:14 pm

Re: Background color line graph widget

Post by Summertime01 » Mon Oct 08, 2018 1:09 pm

Hi Klaus,

thank you for this idea! :D
I'm using the new control handler for the widget though, so that the user may resize and move the graph.
http://livecodeshare.runrev.com/stack/902
I imagine it to be difficult to move/resize both the widget and the opaque graphic underneath at the same time. Do you have any idea for that? :?

Thanks. :D

bogs
Posts: 2284
Joined: Sat Feb 25, 2017 10:45 pm

Re: Background color line graph widget

Post by bogs » Mon Oct 08, 2018 1:23 pm

I don't use widgets, so I may be completely off on this, but with plain graphics you would do something like (psuedo code) ~

Code: Select all

set the width of [object x] to the width of [object y]
where the widget would be object x and the graphic would be object y.

Do widgets have that same type of setting? If they do, you could call that handler after the background is resized.
Image

Klaus
Posts: 10394
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Background color line graph widget

Post by Klaus » Mon Oct 08, 2018 1:43 pm

Maybe a "resizecontrol" handler in the widget will do the trick?

[-hh]
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 1782
Joined: Thu Feb 28, 2013 11:52 pm
Location: Göttingen, DE

Re: Background color line graph widget

Post by [-hh] » Mon Oct 08, 2018 7:21 pm

I have no time for a pull request (probably try to learn in the next weeks), meanwhile you could use the following.
  • Change the ending of the attached file from "zip" to "lce" (do NOT unzip).
  • Add the widget: Locate this lce-file with the Extension Manager (use the plus at topright).
  • Restart LiveCode.
You will see a second chart icon that has the tooltip "Line Graph Temp" and has included
  • properties "showXLabels" and "showYLabels"
  • property "graphBackColor"
(use the property inspector or LC Script to set or get them, see also the dictionary entries).
This will do what you want.

Please note.
Of course, I had to use another signature (kind "livecode.community.hermann.linegraphtempii") because I cannot use kind "com.livecode.widget.linegraph".
Attachments
livecode.community.hermann.linegraphtempii.1.2.1.zip
(37.08 KiB) Downloaded 40 times
shiftLock happens

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”