Hi.

I'm not sure what you meant to do with the function to handle the jQuery.
When you want the chart to appear, you should have a visible div and
afterwards run the two rows that you wrote here to actually draw it. Nothing
else is needed (the inner html of the div will dynamically be updated to the
chart).

If this still doesn't work, please try to be more specific in the
description of what is the timeline of your code.

Hope this helps,
  Viz Kid

On Fri, Mar 19, 2010 at 8:00 AM, mkb5150 <[email protected]> wrote:

> Hello,
>
> I am trying to use the API to create an interactive pie chart based on
> a user's form selections.  jQuery is used to update the div upon a
> selection change.  I used to use a simple image from the google charts
> API, and this worked perfectly.  But now that I have modified the code
> to put javascript in the div, the div reloads empty.  When I run the
> javascript on its own in a separate file, it works fine, just not when
> trying to refresh through jquery.
>
> Here are the last 2 lines of the javascript to produce the chart
> ('leadchart' is the id of the div tag to print to):
>
> var chart = new
> google.visualization.PieChart(document.getElementById('leadchart'));
> chart.draw(data, {width: 400, height: 240, is3D: true, title: 'Lead
> Graph'});
>
> Here is my jQuery function to handle when the form selection is
> changed:
>
> $("#dateRange").change(function(){
>        $.get("/includes/get_chart.php", { dateRange: $
> ("#dateRange").val() },
>          function(data){
>                $("#leadchart").html(data);
>          });
>  });
>
> Anyone know how to get this able to refresh dynamically?
> Thanks 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]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>

-- 
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.

Reply via email to