0

I'm trying to load a chart using HighCharts.

I've created a function that takes the relevant data and creates a new garph, If I manually take the data and hardcode it instead of using the parameters to pass the info everything works great, but I'm not sure what's wrong with the way I'm passing them:

JSFiddle: http://jsfiddle.net/4GBNQ/

Or Weinberger
  • 7,332
  • 23
  • 71
  • 116

2 Answers2

4

You were passing the data as strings, it needs to be passed as an array, like this:

createGraph(
    "3333",
    "123123",
    ['04/10/2012','05/10/2012','06/10/2012','07/10/2012','08/10/2012','09/10/2012'],
    [98,98,97,96,96,94]
);

Updated fiddle

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
0

change your code as below

$(document).ready(function() {
createGraph("3333","123123",['04/10/2012','05/10/2012','06/10/2012','07/10/2012','08/10/2012','09/10/2012'],[98,98,97,96,96,94]);

});

if you observe, i have removed "" for your arrays

Rohini Kumar
  • 249
  • 1
  • 5
  • 15