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: 52
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Weird can't redraw chart problem - solved

Post by bbalmerTotalFluency » Wed Feb 21, 2024 7:56 am

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: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Weird can't redraw chart problem - solved

Post by jacque » 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.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9842
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Weird can't redraw chart problem - solved

Post by FourthWorld » Wed Feb 21, 2024 7:18 pm

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: 7239
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Weird can't redraw chart problem - solved

Post by jacque » Wed Feb 21, 2024 8:07 pm

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: 135
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: Weird can't redraw chart problem - solved

Post by bobcole » Fri Feb 23, 2024 9:45 pm

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: 52
Joined: Mon Apr 06, 2020 1:19 pm
Location: Thailand
Contact:

Re: Weird can't redraw chart problem - solved

Post by bbalmerTotalFluency » Fri Mar 08, 2024 9:24 am

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: 135
Joined: Tue Feb 23, 2010 10:53 pm
Location: Saint Louis, Missouri USA

Re: Weird can't redraw chart problem - solved

Post by bobcole » Fri Mar 08, 2024 5:50 pm

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

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”