Page 1 of 1

Background color line graph widget

Posted: Mon Oct 08, 2018 11:37 am
by Summertime01
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.

Re: Background color line graph widget

Posted: Mon Oct 08, 2018 12:40 pm
by Klaus
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

Re: Background color line graph widget

Posted: Mon Oct 08, 2018 1:09 pm
by Summertime01
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

Re: Background color line graph widget

Posted: Mon Oct 08, 2018 1:23 pm
by bogs
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.

Re: Background color line graph widget

Posted: Mon Oct 08, 2018 1:43 pm
by Klaus
Maybe a "resizecontrol" handler in the widget will do the trick?

Re: Background color line graph widget

Posted: Mon Oct 08, 2018 7:21 pm
by [-hh]
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".