Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Netscape graph.js & arrays

Status
Not open for further replies.
Aug 23, 2001
3
GB
Hello

I am reading the contents of a Cookie into an array, which expands according to the number of comma separated values the cookie retrieves.

I am then trying to pass the array onto Netscapes? graph.js ( to plot the results on a graph.

The problem is the g.addRow function of the script expects the values to be like:
g.addRow( 0,1,-1,0,1,1,1,-1,0,1,-1);

However, if I try to add my array values to this by .concat'enating or by .join'ing the array, I get a lovely black square. For example (no, not of the black square of the code)

<SCRIPT language=&quot;JavaScript1.2&quot;>
var glb_How = new Array()
var glb_Results = readVoteCookie();
splitVoteResults();
var glb_graphValues = glb_How.join();
var persGraph = new Graph(500,275);
persGraph.scale = 1;
persGraph.setXScale ( 0,0,1 );
persGraph.addRow ( glb_graphValues );
// persGraph.addRow ( 1,1,0,-1,0,0,1,1,-1,1,0,1,1 );
persGraph.build ();

</SCRIPT>

I think that it's because of the string double quotes around the values, but I don't see (hmm glasses perhaps) how I can get round this.

The original author? of graph.js, M Bostek of Netscape fame ain't there anymore. So, does anyone know how to concatenate an array into a string, without making it a string or something, aaarrrrgghhh....



Eugh. I've hit the floor. Ooh, a bruise. It took me weeks to get cookies working, and now this, I just almost can't cope.

Please help, I'm nice, I don't bite, (unlike some dragons mentioned) and best of all I'm house trained, just don't take me into a bungalow. And I'm doing this for FUN????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top