Hi,
i wrote the code exactly as you sent me.. but (again) it doesn't works.
It's returns no errors, but nothing happens when i change the date range
with the selector.
this is the code:
> <script type='text/javascript'>
> google.load('visualization', '1', {'packages':['annotatedtimeline']});
> google.setOnLoadCallback(drawchart);
>
> function drawchart() {
> var data = new google.visualization.DataTable();
> data.addColumn('date', 'Data');
> data.addColumn('number', '8a+ Eiger');
> data.addColumn('number', 'Benchmark');
>
>
data.addRows([[new Date(2007, 8, 24), 5, 100], [new Date(2007, 8, 25),
> 4.992, 99.3632911510798], [new Date(2007, 8, 26), 5.026, 100.075701244891],
> [new Date(2007, 8, 27), 5.029, 100.568918725117], [new Date(2007, 8, 28),
> 5.028, 100.422972180913], [new Date(2007, 9, 1), 5.066, 100.983706987663],
> [new Date(2007, 9, 2), 5.105, 101.33220551144], [new Date(2007, 9, 3),
> 5.116, 101.223086599886], [new Date(2007, 9, 4), 5.107, 101.199216837983],
> [new Date(2007, 9, 5), 5.12, 101.900033047442], [new Date(2007, 9, 8),
> 5.109, 101.509796539995], [new Date(2007, 9, 9), 5.132, 101.744811395756],
> [new Date(2007, 9, 10), 5.114, 101.662290218893], [new Date(2007, 9, 11),
> 5.131, 102.283722420195],* ...[more data]...* ,[new Date(2011, 11, 21),
> 4.031, 62.4198950276071], [new Date(2011, 11, 22), 4.106,
> 63.1765567371575], [new Date(2011, 11, 23), 4.134, 63.6342326290487], [new
> Date(2011, 11, 27), 4.117, 63.6328296716144], [new Date(2011, 11, 28),
> 4.047, 62.7017335877363], [new Date(2011, 11, 29), 4.101,
> 63.6848949808418]]);
>
>
var chart = new
> google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
>
> var options = {width: 300, height: 300, displayAnnotations: 'false',
> legend: 'right', scaleType: 'allfixed'};
>
> chart.draw(data, options);
>
> google.visualization.events.addListener(chart, 'rangechange', function ()
> {
> var start = chart.getVisibleChartRange().start;
> var end = chart.getVisibleChartRange().end;
> var fooBase = chart.getValue(chart.getFilteredRows(start)[0], 1);
> var barBase = chart.getValue(chart.getFilteredRows(start)[0], 2);
> var view = new google.visualization.DataView(data);
> view.setColumns([0, {
> type: 'number',
> label: 'foo',
> func: function (dataTable, rownum) {
> return dataTable.getValue(rownum, 1) / fooBase;
> }
> }, {
> type: 'number',
> label: 'bar',
> func: function (dataTable, rownum) {
> return dataTable.getValue(rownum, 2) / barBase;
> }
> }]);
> chart.draw(view, options);
> });
> }
> </script>
>
Thanks,
Marco
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/aLXeSiHZI-MJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.