Question content:
When using fusioncharts, you may want to click on a part of the Chart on a page such as demo.html and then display the details of this part.
Fusioncharts has setDataXML and setDataURL. These two methods are used to set data. However, there will be garbled code problems (which may occur in AJAX situations). Those who have used them should understand.
The specific details will not be explained in detail.
Solution.
If the return content of your Ajax request is garbled, use Jquery.ajax directly.
Copy the code code as follows:
function mychartclick(month) {
var id =1;
var d = new Date();
var strURL='xxxx'
jQuery.ajax({
type: "Get",
url: strURL
data: strURL,
success: function (data) {
var chartObj = getChartFromId("myid");
chartObj.setDataXML(data); //Just use data to set the content of myid directly.
}
});
}
The garbled characters are gone..