0

I'm trying to configure to my google candlestick chart a grouping format by date, as I saw it required a continuous axis (all the hAxis options are followed by: This option is only supported for a continuous axis.)

I know i need to add a continuous axis, but HOW am i doing this ?? I was trying for 2 days to play with the settings without any luck.

Alon
  • 889
  • 10
  • 16
  • Do you have an example or jsfiddle? – j0nes Sep 03 '12 at 13:17
  • No because im getting js error when i try to put a date format inside my array. I just want a smiple example how to combine haxis group of dates inside the candlestick chart – Alon Sep 03 '12 at 13:47

1 Answers1

1

Build a datatable instance without using the arrayToDataTable() method or it will raise an exception. Define your horizontal axis as 'date' and use Date() objects instead of strings.

var data = new google.visualization.DataTable()
data.addColumn('date', 'Date');
data.addColumn('number', 'Whatever');
rows = [
    [new Date('2009-10-01'), 1230],
    [new Date('2009-11-01'), 1290],
    [new Date('2012-02-01'), 3690],
];
data.addRows(rows);

It should be enough.

carles
  • 360
  • 4
  • 16