Hi, I am making a Stepped Area Annotation Chart and here is my code:
https://jsfiddle.net/yannycheng/c9q0m48p/4/#&togetherjs=A088VEPHpu
Here is a simplified version of it.
var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', 'Data Set 1');
data.addColumn({
'type': 'string',
'role': 'annotation'
});
data.addColumn('number', 'Data Set 2');
data.addColumn({
'type': 'string',
'role': 'annotation'
});
data.addRows([
[new Date(2010, 1, 1), 0, 'event 1', 0, undefined],
[new Date(2010, 1, 2), 20, 'event 2', 40, undefined],
[new Date(2010, 1, 3), 30, 'event 3', 45, undefined],
[new Date(2010, 1, 4), 40, 'event 4', 50, undefined],
[new Date(2010, 1, 5), 50, 'event 5', 60, undefined],
]);
var chart = new
google.visualization.AnnotationChart(document.getElementById('chart_div'));
var options = {
chart: {
isStacked: false,
annotations: {
alwaysOutside: true,
},
seriesType: 'steppedArea',
selectionMode: 'multiple',
},
displayAnnotations: true,
scaleColumns: [0, 1],
displayExactValues: true,
fill: 10,
};
chart.draw(data, options);
When I click on Feb 1, 2010 on the graph, I expected to have 'Data Set 1 =
0, and 'Data Set 2 = 0', however, the graph is showing 'Data Set 1 = 20,
and 'Data Set 2 = 40', which is the data for Feb, 2, 2010. How can I fix
it? Thanks you for your help!
-yanny
--
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 [email protected].
To post to this group, send email to [email protected].
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/7fc75242-baf3-4bf9-8912-359b32f601e4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.