I am charting historical Stock Exchange Data and I want to know how to 
select two points, so I can store them in form inputs as a Start Date and 
End Date to use in my code for another API. 

I have

function drawChart(chartData, data) {
google.charts.load('current', { 'packages': ['line'] });
google.charts.setOnLoadCallback(drawChart);

function drawChart() {

var data = new google.visualization.DataTable();
data.addColumn('date', 'Date');
data.addColumn('number', `${addCompanyName} Closing Price`);
for (var x = 0; x < chartData.length; x++) {
const chartDate = (chartData[x].date);
const chartClose = (chartData[x].close)
data.addRows([
[new Date(chartDate), chartClose],
]);
}
var options = {
selectionMode: 'multiple',
chart: {
title: `${addCompanyName}`,
subtitle: '5 years Growth'
},
width: 900,
height: 500,
axes: {
x: {
0: { side: 'top' }
}
}
};

var chart = new google.charts.Line(document.getElementById('line_top_x'));

chart.draw(data, google.charts.Line.convertOptions(options));

}

}

So far I have Selection mode set to multiple, Is there any way I can limit 
that Selection to 2? And how can I grab the date to use for later?  Thanks 
for an advance to anyone reading this, any help would be greatly 
appreciated!

-- 
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/c37c85c5-0733-4595-8c43-e8d560ecff31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to