Weird can't redraw chart problem - solved

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Weird can't redraw chart problem - solved

Post by bbalmerTotalFluency »

Hi:

I want to alter the data on a chart and then redraw the chart to reflect new colours and new data.

1. There is no "redraw" command in the chart widget to trigger a redraw
2. People have said that "set the backgroundColor of me to the backgroundColor of me" sent from the card will cause a redraw but it didn't work for me
3. That command DOES work from the msg box - interesting
4. If I put that command in my stack wrapped in a named command and SEND a message to the stack that calls my command - IT DOES WORK. Problem solved.

Sort of solved. It works perfectly fine. I don't have a robust solution because I haven't yet tested it extensively. It appears to work. Which is a great deal of progress from before. I wanted to make this info available in case anyone else was suffering the same way I was suffering.

Also, I noticed there is a "redraw" command in the dictionary which supposedly will redraw the card. That would be the neatest solution if it works. I have not bothered to test it since this problem has put me behind on a deadline and I have a working solution.
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Weird can't redraw chart problem - solved

Post by jacque »

I don't see a redraw command in the dictionary. I do see three commands that are either inactive or apply only to specific controls like the (deprecated) Browser.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10103
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Weird can't redraw chart problem - solved

Post by FourthWorld »

jacque wrote: Wed Feb 21, 2024 6:07 pm I don't see a redraw command in the dictionary. I do see three commands that are either inactive or apply only to specific controls like the (deprecated) Browser.
There's a "redraw" item in the Glossary portion of the Dictionary window.

The Dictionary defaults to showing both language elements and glossary terms, requiring readers looking to learn the language to work harder to make sure they either change the default setting when searching, or pay closer attention to which category of entry they're looking at.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7423
Joined: Sat Apr 08, 2006 8:31 pm
Contact:

Re: Weird can't redraw chart problem - solved

Post by jacque »

There's a "redraw" item in the Glossary portion of the Dictionary window.
That makes more sense. And here I was about to get all excited.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 175
Joined: Tue Feb 23, 2010 10:53 pm

Re: Weird can't redraw chart problem - solved

Post by bobcole »

When one puts data into the lineChart widget's Property Inspector the chart is automatically updated.
This happens when one enters the data by hand or by script.
I guess that I don't understand the case presented by the Original Poster (OP).
Bob
bbalmerTotalFluency
Posts: 84
Joined: Mon Apr 06, 2020 1:19 pm
Contact:

Re: Weird can't redraw chart problem - solved

Post by bbalmerTotalFluency »

The redraw is automatic on osx but not on the iPhone, at least not for me. I had expected the auto-redraw behaviour and was surprised when i didn't get it. In the end changing the dataBackgroundColors provoked a redraw.
bobcole
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 175
Joined: Tue Feb 23, 2010 10:53 pm

Re: Weird can't redraw chart problem - solved

Post by bobcole »

Ah! Now I understand. I was testing on MacOS.
Glad you found a workaround.
Bob
Post Reply