ok
I run this code
http://code.google.com/apis/visualization/documentation/dev/dsl_csv.html#intro
when I hit the address I get the following result
............................................}]},{c:[{v:'Tiger'},
{v:'http://en.wikipedia.org/wiki/Tiger'},{v:80.0},{v:false}]} which is
ok
then i run the following code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!DOCTYPE html>
<html>
<head>
<title>Getting Started Example</title>
<!--Load the AJAX API-->
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript">
//Load the Visualization API and the ready-made Google table
visualization
google.load('visualization', '1', {'packages':['table']});
// Set a callback to run when the API is loaded.
google.setOnLoadCallback(init);
// Send the query to the data source.
function init() {
// Specify the data source URL.
var query = new google.visualization.Query('Beat');// name of my
servlet
// Send the query with a callback function.
query.send(handleQueryResponse);
}
// Handle the query response.
function handleQueryResponse(response) {
if (response.isError()) {
alert('Error in query: ' + response.getMessage() + ' ' +
response.getDetailedMessage());
return;
}
// Draw the visualization.
var data = response.getDataTable();
var chart = new
google.visualization.Table(document.getElementById('chart_div'));
chart.draw(data, {width: 600, height: 150, is3D: true});
}
</script>
</head>
<body>
<h1>Hello! Data Source!</h1>
A table chart that shows data taken from the simple data source.
<!--Div that will hold the visualization-->
<div id="chart_div"></div>
</body>
</html>
And I get perfect chart.
Now I want to design such that when the user hits the address to the
servlet I dont want the following result
............................................}]},{c:[{v:'Tiger'},
{v:'http://en.wikipedia.org/wiki/Tiger'},{v:80.0},{v:false}]} which is
ok
instead i want to draw the chart directly using the the above html
page.
I tried using dispactcher.forward(XXX.html);
but i am getting error.
So i got hint from the site....
http://code.google.com/apis/visualization/documentation/dev/dsl_key_concepts.html
Has anyone tried this or what should be the approach to process and
draw the chart on one hit and just showing the chart on user's
browser?
On Jun 10, 10:18 am, Badtnik <[email protected]> wrote:
> Hey, can you send a simple code snippet causing that response and we
> can help you debug it?
>
> On Jun 10, 5:11 pm, Akku <[email protected]> wrote:
>
> > I am following this
> > tutorialshttp://code.google.com/apis/visualization/documentation/dev/dsl_csv.html
>
> > It works fine for me but i am facing one problem
>
> > at the following step given by google
> > Updating Your Web Application on Apache Tomcat
> > Click the following
> > link:http://localhost:8080/myWebApp/csv?url=http://localhost:8080/myWebApp...
>
> > The screen displays 6-7 lines of text, depending on your screen width.
> > The text begins with google.visualization.Query.setResponse
> > and ends with {c:[{v:'Bob'},{v:'Jane'}]}]}});
>
> > This is the response that the example CSV data source sends to a
> > visualization.
>
> > I DONT want this thing coming in my browser
> > instead i want to directly draw the chart after user hit the link
> > as given by google
> > Using a Visualization to View the Data
> > The all_examples.html file in the <data_source_library_install>/
> > examples/src/html directory can be used to view a visualization of the
> > data.
>
> > what can i do to follow all the step and directly draw the chart ?
> > thanking you in advance
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
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.