It is currently 20 September 2024, 4:21 Advanced search

Google Charts - Error message

Questions and answers on how to best use Instant Developer

Google Charts - Error message

Postby john w » 2 March 2023, 17:55

I have a person who would like to change the error message Google Charts presents in certain situations. The message presented is "Negative values are invalid for a pie chart". They would like it to be "Site Value plus Cost are too low for Market Value".

It appears that Google Charts is the source of the message. Can anyone give me guidance on how to change this error message?
Regards

John W
User avatar
john w
 
Posts: 819
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Google Charts - Error message

Postby ljwilson » 3 March 2023, 14:01

Can you not figure out that issue before the chart is rendered? If so then give the message then and never draw it.

I did a quick search and it looks non-trivial to change the default messages coming from Google Charts.

...jack
ljwilson
 
Posts: 772
Joined: 26 November 2013, 14:15

Re: Google Charts - Error message

Postby john w » 3 March 2023, 15:21

I am wondering if I can trap the error before it gets to the chart. I would to determine what logic created the Negative values. I need to think about it somemore.
Regards

John W
User avatar
john w
 
Posts: 819
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA

Re: Google Charts - Error message

Postby john w » 6 March 2023, 15:11

I was able to trap the error based on the data that would create the error. I was able to give the useful message to the user. Perhaps not as elegant as dealing with the error in the Google Chart api, but just as useful.
Regards

John W
User avatar
john w
 
Posts: 819
Joined: 24 October 2012, 16:29
Location: Apple Valley, Minnesota USA


Return to Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests