Subject: [visualization-api] Localize "No Data Available" in annotatedtimeline

52 views
Skip to first unread message

krupesh shah

unread,
Apr 10, 2012, 3:15:28 AM4/10/12
to Google Visualization API
Hello sir,

I have use annotatedtimetime in MVC3. Dynamically data display in
annotatedtimeline through JSON + Jquery.
No data display error found during report open IE8. But during debug
FireFox display proper.

I have use below code.


<head>
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<title>@ViewBag.Title</title>
<script type="text/javascript" src="http://www.google.com/jsapi"></
script>
<script type="text/javascript" src="../../Scripts/jsapi.js"></
script>
<script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1/jquery.min.js"></script>

<script type='text/javascript'>

// debugger;
google.load('visualization', '1', {'packages':
['annotatedtimeline'],'language' : 'en'});

google.setOnLoadCallback(drawChart);
function drawChart() {
var data = new google.visualization.DataTable();
data.addColumn('date', 'DateCol');
data.addColumn('number', 'Sal');
data.addColumn('string', 'Name');
data.addColumn('number', 'Basic');
data.addColumn('string', 'EmpComment');

$.getJSON("@Url.Content("~/Home/CollectJsonData")",function
(userData){
if(userData != null)
{
$.each(userData, function (index, itemData){
data.addRows([
[new Date (itemData.EmpHireDateYear ,
itemData.EmpHireDateMonth , itemData.EmpHireDateDay),
itemData.EmpSal, itemData.EmpName,
itemData.EmpBasic,itemData.EmpComment]
]);


});

}
});

var chart = new
google.visualization.AnnotatedTimeLine(document.getElementById('chart_div'));
chart.draw(data,{displayAnnontations: true });



}
</script>
</head>
@{
ViewBag.Title = "Home Page";
}
<h2>@ViewBag.Message</h2>
<p>
To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc"
title="ASP.NET MVC Website">
http://asp.net/mvc</a>.
</p>
<div id='chart_div' style='width: 700px; height: 240px;'>
</div>


"No Data Avilable" display during run page.

I am waiting your reply.

Thanks is advance.

Regards,
Krupesh K. Shah.

asgallant

unread,
Apr 10, 2012, 10:02:53 AM4/10/12
to google-visua...@googlegroups.com
If it's working in Firefox, my first inclination is to say that the JSON returned by the AJAX call has an errant comma in it somewhere.  Can you post a sample of the JSON returned?
Reply all
Reply to author
Forward
0 new messages