Tip: How to use ajax to get extra info for tooltip

We need extra info to show when moving cursor to point.

Javascipts:

	formatter: function() {
		var rV = null;
		$.ajax({
		  dataType: "json",
		  url: 'getDetail.php?tester='+this.series.name,
		  async: false, // this will stall the tooltip
		  success: function(data){
			rV = data.tester;
		  }
		});
		return rV;
	 }

PHP:

<?php
header("Content-type: text/json");

$items['tester']=$tester.'ABCDEFG';
print json_encode($items);
?>

  

posted @ 2015-05-15 13:56  rongbin  阅读(170)  评论(0)    收藏  举报