Hi Daniel,
Actually on my main form I tried the following:
$(document).ready(function () {
alert('1');
google.load('visualization', '1.0', { 'packages': ['corechart'] });
alert('2');
the form came up properly at first alert, and the whole page was blank
after the second one.
Volkan
On Monday, August 25, 2014 3:27:36 PM UTC-4, [email protected] wrote:
> Hi,
>
> Hi have the following partial view that works properly when called from
> the command line such as:
>
>
> http://localhost:59739/OptionPortfolio/googleScatterChart/?ivyID=122392&ticker=GLD&ivyID2=126928&ticker2=GDX&dtStart=3%2F15%2F2014+12%3A00%3A00+AM&dtEnd=8%2F22%2F2014+12%3A00%3A00+AM
>
>
> Partial view:
>
> <script type="text/javascript">
>
> google.load("visualization", "1", { packages: ["corechart"] });
>
> google.setOnLoadCallback(drawChart);
>
> function drawChart() {
>
> var mod = @Html.Raw(Json.Encode(Model));
>
> var titre= @Html.Raw(Json.Encode(Model.title));
>
> var titre_x= @Html.Raw(Json.Encode(Model.title_x));
>
> var titre_y= @Html.Raw(Json.Encode(Model.title_y));
>
> var min_x= @Html.Raw(Json.Encode(Model.min_x));
>
> var max_x= @Html.Raw(Json.Encode(Model.max_x));
>
> var min_y= @Html.Raw(Json.Encode(Model.min_y));
>
> var max_y= @Html.Raw(Json.Encode(Model.max_y));
>
> var jsonData = $.ajax({
>
> url: '/OptionPortfolio/googleChartData',
>
> data: mod,
>
> dataType: "json",
>
> async: false
>
> }).responseText;
>
> // Create our data table out of JSON data loaded from server.
>
> var datatbl = new google.visualization.DataTable(jsonData);
>
> var options = {
>
> title: titre,
>
> hAxis: { title: titre_x, minValue: min_x, maxValue: max_x },
>
> vAxis: { title: titre_y, minValue: min_y, maxValue: max_y },
>
> legend: '',
>
> };
>
> var chart = new
> google.visualization.ScatterChart(document.getElementById('chart_div'));
>
> chart.draw(datatbl, options);
>
> }
>
> </script>
>
> <div id="chart_div" style="width: 900px; height: 500px;"></div>
>
>
>
> however, the whole page goes blank when called from the main page:
>
> $.ajax({
>
>
> url: '@Url.Content("/OptionPortfolio/googleScatterChart/")',
>
> data: kk,
>
> success: function (result) {
>
> $('#googlechart_div').html(result);
>
> },
>
> error:
>
>
> function (result) {
>
> alert(result);
>
> }
>
> });
>
>
>
>
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Chart 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-chart-api.
For more options, visit https://groups.google.com/d/optout.