Error caused by string being too big when passed to Google Visualization API -


I'm trying to create one through one. You must create a google.visualization.DataTable and add the string to a cell in the table. I originally copied the above example, and passed a simple string of some words (@not.notest), and WordCloud did the right thing.

  & lt; Script type = "text / javascript" & gt; Google.load ("Visualization", "1"); Google.setOnLoadCallback (Draw); Function draw () {var data = new google.visualization.DataTable (); Data.addColumn ('string', 'text1'); Data.addRows (1); Data.setCell (0, 0, 'and lt;% = @note.colortext%> gt;'); Var outputDiv = document.getElementById ('wcdiv'); Var wc = new WordCloud (outputDiv); Wc.draw (data, {width: 300, height: 300}); } & Lt; / Script & gt;  

But I want to create WordCloud based on an article, which (obviously) is a very large string. When I'm in a string containing an entire article, I get the following error:

  The string that is not ending verbatim data.Set cell (0, 0, 'a da ... was a Ended up with your time-out in a cradle.  

Again, this error does not occur when I pass in a small string, so this is due to the size of the string Or potentially google.visualization.There is a limitation of DataTable that how much a single cell is (I can not get this type of boundary mentioned). Does anyone know how I can fix this? Thanks for reading.

Edit: In the case of It is important, I am using Ruby on Rail.

The text you add to the dataset Probably many lines spread due to 'unsaturated string literal' error.

Try to parse the text And put it in one line or add a row on a row by row.


Comments