Jump to content

Small issue with a function


Shadowing

Recommended Posts

I'm trying to get a plug in to work that I grabed on line and I can't figure out a certain part of that is unclear They supplied a function that is suppose to change the format of my array so it works with their plug inIdk this function is beyond my understanding lol.Either way they say it can take an array and make it look like[[[x1, sin(x1)], [x2, sin(x2)], ...]] My array that is coming from php via ajax looks like

Object {1362713346="153.549", 1362761347="153.549", 1362761401="103.549"}

var plot = function() {       var data = [[]];       for (var i=0; i<13; i+=0.5) {	     data[0].push([i, Math.sin(i)]);       }       return data;     };

so i tried inserting my array 3 differant ways. only first one doesnt throw an error. returns function() thoughdata = [[array]]data = [array]data =[array here's the link of showing all thishttp://www.jqplot.com/tests/data-renderers.php

Link to comment
Share on other sites

idk i think im going to just make my own function that puts in the correct format. I think this route on their example is showing how to change the line graph dynamticly which isnt really what im doing since im echoing in the html on each view

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...