a.trim is not a function error

674 views
Skip to first unread message

jasson calderon villalobos

unread,
Oct 25, 2017, 12:35:48 PM10/25/17
to Google Visualization API
Hi everyone!

I am having the following issue:

I have 4 dynamically column charts but just one of them is showing the information from DB, the other 3 are showing "a.trim is not a function" in fact I am not using the "trim" function... I assume the google API do it for itself... So, I need to know how to fix this issue because in the past neither of them were showing information and instead they showed the same message. After some changes in the code, the browser started to show information but only in the first one.

Just one more thing, the error is prompted in the interface, not in the console... That is why I am asking here, because all the issues related that I found in internet showed the error in the console. 

Additionally, I tested in different browsers and still have the same results.

To see the chart working, check attached (CapturaBuena)
To see the chart on error, check attached (CapturaMala)
To see the code of the chart, check attached (CapturaCodigo)
To see the console -where there is not error related-, check attached (CapturaConsola)

Thanks a lot for your help!
CapturaBuena.PNG
CapturaCodigo.PNG
CapturaConsola.PNG
CapturaMala.PNG

Daniel LaLiberte

unread,
Oct 25, 2017, 2:09:56 PM10/25/17
to Google Visualization API
Hi Jasson,

I just did a search through our code for all uses of any trim function.  All (but one, in our uses actually use google.string.trim(), which is defined as you can see here:  https://github.com/google/closure-library/blob/master/closure/goog/string/string.js#L333
I notice that you might pass it a non-string value, such as a number, in which case it will likely fail to find the trim function.

So there could be a bug in which either your data is not strings where strings are expected, or something internal to the library tries to trim a non-string.  Could you point to a web page demonstrating the error?  Or provide enough details to reproduce the problem.

Whether an error shows up in the console or in your chart display area depends entirely on whether the error can be captured.  We generally try to capture all errors to display them in the chart area.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/7ec5ad74-c217-462b-9ed5-f118014e21ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages