Timeline chart: how to start week from Monday

253 views
Skip to first unread message

Dan

unread,
Jan 8, 2016, 2:45:08 PM1/8/16
to Google Visualization API
Hello all!
Below is a code for timeline.
The problem is that dates on hAxis are always Sundays + in some cases Sundays are bold comparing to other dates on hAxis.
Is there any solution how to start weeks from Mondays?

function drawChart() {
    var container = document.getElementById('visualization');
    var chart = new google.visualization.Timeline(container);
    var dataTable = new google.visualization.DataTable();
    dataTable.addColumn({
        type: 'string',
        id: 'Term'
    });
    dataTable.addColumn({
        type: 'string',
        id: 'Name'
    });
    dataTable.addColumn({
        type: 'string',
        role: 'style'
    });
    dataTable.addColumn({
        type: 'datetime',
        id: 'Start'
    });
    dataTable.addColumn({
        type: 'datetime',
        id: 'End'
    });
    dataTable.addRows([
        ['1', 'test1', 'color: #00f000;', new Date(2015, 11, 1), new Date(2015, 11, 21)],
        ['2', 'test2', 'color: #00ff00;',  new Date(2015, 11, 1), new Date(2015, 11, 15)],
        ['3', 'test3', 'color: #00ff00;',  new Date(2015, 11, 1), new Date(2015, 11, 31)],
        ['2', 'test2', 'color: #ffff00;',  new Date(2015, 11, 1), new Date(2015, 11, 23)]
    ]);

    var options = {
            timeline: { showRawLabels: true, showBarLabels: false },
            avoidOverlappingGridLines: false,
            tooltip: {isHtml: true},
            hAxis: {
                format: 'd-MMM',
            }
    };

    chart.draw(dataTable, options);
}

Daniel LaLiberte

unread,
Jan 8, 2016, 6:22:55 PM1/8/16
to Google Visualization API
Sorry Dan.  We don't have any options for start-of-week, though it is a good idea.  We'll investigate supporting that in the future.

--
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 https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/db6546b4-ded9-4c12-aecf-f6d419b4fd6e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages