There's a wikiHow article on this:
http://www.wikihow.com/Make-a-Google-Chart-with-User-Input
On Monday, June 23, 2014 8:51:13 PM UTC-4, Andrew Gallant wrote:
>
> Yes, you can do that. Here's one way:
>
> function drawChart() {
> var data = google.visualization.arrayToDataTable([
> ['Compromise', 'Quantity'],
> ['Value #1', 0],
> [' ', 0],
> ['Value #2', 0]
> ]);
> var options = {
> title: 'Quick Compromise Graph',
> hAxis: {title: 'Graph Creator', titleTextStyle: {color: 'black'}}
> };
>
> var chart = new
> google.visualization.ColumnChart(document.getElementById('chart_div'));
> chart.draw(data, options);
>
> var bidEl = document.getElementById('bidgraphvalue');
> var askEl = document.getElementById('askgraphvalue');
>
> function updateChart () {
> var bid = bidEl.value * 1;
> var ask = askEl.value * 1;
> data.setValue(0, 1, ask);
> data.setValue(2, 1, bid);
>
> chart.draw(data, options);
> }
>
> // create event handlers for changing the chart's data
> if (document.addEventListener) {
> bidEl.addEventListener('change', updateChart);
> askEl.addEventListener('change', updateChart);
> }
> else {
> bidEl.attachEvent('onchange', updateChart);
> askEl.attachEvent('onchange', updateChart);
> }
> updateChart();
> }
>
> On Sunday, June 22, 2014 11:49:30 PM UTC-4, Ej Nov wrote:
>>
>> Another way you could accept user input is through setting a forum input
>> with an onkeypress function to update a graph.
>>
>> For example:
>>
>> Website: http://www.quickcompromise.com/index.html (Website where the
>> graph is displayed)
>>
>> Chart Code:
>> https://drive.google.com/file/d/0Bw_K4bx8LBQuZWR1REFZRlBmVHc/edit?usp=sharing
>> (Website
>> Code)
>>
>>
>>
>> On Monday, July 9, 2012 1:07:21 PM UTC-4, croberts wrote:
>>>
>>> Hello
>>>
>>> I am working with Django.
>>>
>>> I'd like users on my site to have the ability to enter data points and
>>> then have it charted. Each user will have their own chart.
>>>
>>> Does Google Visualization API have the ability to do this?
>>>
>>>
>>>
--
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 http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.