Hi,
I'm using Visualization API, and specially, the annotatedtimeline graph.
I want to do several things:
- First, in the legend, I want to display only the legends of the curves currently on the mouse position. For example, in the sample code I provide, when the mouse is on the red curve, I don't want to see the blue legend. I didn't find how to to this.
- I also want to display log scale
- And then, is it possible to display reverse scales?
Thanks for any help
Johann
function drawVisualization()
{
var data = new google.visualization.DataTable();
data.addColumn('datetime', 'Heure');
data.addColumn('number', 'Curve1');
data.addColumn('number', 'Curve12');
data.addRows(16);
data.setValue(0, 0, new Date(2011, 7 ,22 ,1 ,0));
data.setValue(0, 1, 0);
data.setValue(1, 0, new Date(2011, 7 ,22 ,1 ,15));
data.setValue(1, 1, 0);
data.setValue(2, 0, new Date(2011, 7 ,22 ,1 ,30));
data.setValue(2, 1, 0);
data.setValue(3, 0, new Date(2011, 7 ,22 ,1 ,45));
data.setValue(3, 1, 0);
data.setValue(4, 0, new Date(2011, 7 ,22 ,4 ,15));
data.setValue(4, 2, 0);
data.setValue(5, 0, new Date(2011, 7 ,22 ,4 ,30));
data.setValue(5, 2, 10);
data.setValue(6, 0, new Date(2011, 7 ,22 ,4 ,45));
data.setValue(6, 2, 100);
data.setValue(7, 0, new Date(2011, 7 ,22 ,5 ,0));
data.setValue(7, 2, 10000);
data.setValue(8, 0, new Date(2011, 7 ,22 ,5 ,15));
data.setValue(8, 2, 10);
data.setValue(9, 0, new Date(2011, 7 ,22 ,5 ,30));
data.setValue(9, 2, 15);
data.setValue(10, 0, new Date(2011, 7 ,22 ,5 ,45));
data.setValue(10, 2, 20);
data.setValue(11, 0, new Date(2011, 7 ,22 ,6 ,0));
data.setValue(11, 2, 18);
data.setValue(12, 0, new Date(2011, 7 ,22 ,6 ,15));
data.setValue(12, 2, 0);
data.setValue(13, 0, new Date(2011, 7 ,22 ,6 ,30));
data.setValue(13, 2, 0);
data.setValue(14, 0, new Date(2011, 7 ,22 ,6 ,45));
data.setValue(14, 2, 0);
data.setValue(15, 0, new Date(2011, 7 ,22 ,7 ,0));
data.setValue(15, 2, 0);
Here's my sample code:
var formatter_short = new google.visualization.DateFormat({pattern: 'dd/MM/yyyy HH:mm'});
formatter_short.format(data, 0);
var timeline = new google.visualization.AnnotatedTimeLine(document.getElementById('visualization'));
timeline.draw(data, {
'displayAnnotationsFilter': true,
'displayExactValues': false,
'dateFormat' : 'dd MMMM yyyy HH:mm:ss',
'legendPosition': 'newRow',
'displayRangeSelector' : false,
'displayZoomButtons': false,
'fill' : 30,
legend:'bottom'
});
}