Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# .NET MVC3
I am loading google block chart on my MVC application using partial view. Chart loaded successfully for the first time using partial view. But i am trying to reduce the number of bar on google block chart by calling same partial view but in that chart is not reloaded.
i am just getting HTML from the partial view not chart related data.
 
there is my partial view code
 
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
   <script type="text/javascript" src="http://www.google.com/jsapi"></script>
   <script type="text/javascript">
       google.load('visualization', '1', { packages: ['corechart'] });
   </script>
   <script type="text/javascript">
 
       function drawVisualization() {
 
           // Create and populate the data table.
           var data = google.visualization.arrayToDataTable(
       [
         ['Months' @Html.Raw(ViewBag.Reseller)   @Html.Raw(ViewBag.Client)   @Html.Raw(ViewBag.Project) ],
         ['@(ViewBag.SixthDate)'   @(ViewBag.MonthResellers6)  @(ViewBag.MonthClient6)   @(ViewBag.MonthProject6)],
         ['@ViewBag.FifthDate'   @(ViewBag.MonthResellers5)  @(ViewBag.MonthClient5)   @(ViewBag.MonthProject5)],
         ['@ViewBag.FourthDate'  @ViewBag.MonthResellers4  @ViewBag.MonthClient4   @ViewBag.MonthProject4],
         ['@ViewBag.ThirdDate'   @ViewBag.MonthResellers3  @ViewBag.MonthClient3   @ViewBag.MonthProject3],
         ['@ViewBag.SecoundDate' @ViewBag.MonthResellers2  @ViewBag.MonthClient2   @ViewBag.MonthProject2],
         ['@ViewBag.FirstDate'   @ViewBag.MonthResellers1  @ViewBag.MonthClient1   @ViewBag.MonthProject1]
       ]);
           // Create and draw the visualization.
           new google.visualization.ColumnChart(document.getElementById('visualization')).draw(data, { title: "Bar Chart",
               width: 600, height: 400,
               hAxis: { title: "Months" }
           }
           );
       }
       google.setOnLoadCallback(drawVisualization);
   </script>
 </head>
 <div id="visualization" style="width: 600px; height: 400px;"></div>
 

Anyone can help me
Thank you
Posted 11-Mar-13 1:31am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web01 | 2.8.1411022.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100