Google Timeline obeying 'style' column

54 views
Skip to first unread message

Mike O'Connell

unread,
Sep 3, 2015, 1:02:33 AM9/3/15
to Google Visualization API
Has anyone gotten 'style' columns to work for timelines or have any idea when they're going to be?

As per the snippet below:

console.log(google);
google.load("visualization", "1.1", {
    packages: ["timeline"]
});
google.setOnLoadCallback(drawMap);

function drawMap() {
    chart = new google.visualization.Timeline(document.getElementById('map_div'));

    loadData();
}

function selected() {
val = chart.getSelection()[0];
    console.log(dataTable.getValue(val.row, 5));
}

function loadData() {
    dataTable = new google.visualization.DataTable();

    dataTable.addColumn({ type: 'string', id: 'President' });
    dataTable.addColumn({ type: 'string', id: 'Name' });
    dataTable.addColumn({ type: 'string', id: 'Tooltip', role: 'tooltip', 'p': {'html': true} });
    dataTable.addColumn({ type: 'date', id: 'Start' });
    dataTable.addColumn({ type: 'date', id: 'End' });
    dataTable.addColumn({ type: 'number', id: 'ID', role: 'hidden' });
    dataTable.addColumn({ type: 'string', role: 'style' });

    dataTable.addRows([
        [ 'Washington', 'prezi', '<div style="padding: 5px;"><p>sometool\'s tip</h1></div>', new Date(1789, 3, 30), new Date(1797, 2, 4), 1, 'color: green' ],
        [ 'Adams', 'prezi', '<div style="padding: 5px;"><p>sometool\'s tip</h1></div>',      new Date(1797, 2, 4),  new Date(1801, 2, 4), 2, 'color: red' ],
        [ 'Jefferson', 'prezi', '<div style="padding: 5px;"><p>sometool\'s tip</h1></div>',  new Date(1801, 2, 4),  new Date(1809, 2, 4), 3, 'color: blue' ]]);

    var options = {
avoidOverlappingGridLines: false,
        tooltip: { isHtml: true },
        timeline: { barLabelStyle: {fontName: "arial", fontSize: "8" }}
    };
    google.visualization.events.addListener(chart, 'select', selected);
        
    chart.draw(dataTable, options);
}

If it's not supported can I make the feature request at the same time?

Sergey Grabkovsky

unread,
Sep 3, 2015, 10:11:07 AM9/3/15
to Google Visualization API
Hi Mike,

This feature is not supported by the Timeline chart at this time. You can make a feature request here: https://github.com/google/google-visualization-issues/issues

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-visualizati...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/b0e2eb64-5307-4df8-b1e8-1f5459c9f212%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages