Can not seem to get my horizontal line chart axis to work properly

11 views
Skip to first unread message

Finn Sohst

unread,
Oct 1, 2015, 10:04:58 AM10/1/15
to Google Visualization API
Hello, I'm trying to generate a line chart like this:

var options = {
                title: 'Tray Data',
                curveType: 'function',
                legend: { position: 'right' }
            };
function (title, axisX, axisY, columns, data)
{
    options.title = title;
    options.hAxis = axisX;
    options.vAxis = axisY;
    var table = new google.visualization.DataTable();
    var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
    for (var c in columns)
        table.addColumn(columns[c][0], columns[c][1]);
    table.addRows(data);
    chart.draw(table, options);
}

I have four colums, the first one containing a Date Object and being the horizontal axis. The axis are formatted like this:
Horizontal: { title: "Time / Date", gridlines: { count: 10, color: '#CCC' }, format: 'dd-MM-yyyy' }
Vertical: { title: "Display Time (s)", gridlines: { count: 10, color: '#CCC' } }


For some reason the resulting chart will not display anything except the title for the horizontal axis, not even the grid lines. I'm not getting any JS errors. Any idea what I am doing wrong ?
Reply all
Reply to author
Forward
0 new messages