我需要针对不同的IE版本执行此.php文件,但是当我模拟以下内容时会出现以下错误:
- IE 8:“ gvjs_VL”未定义。
- IE
当IE版本为
先谢谢您。 :)
<!DOCTYPE html>
<?php
$chartData = array(array("Area","Number of people"),array("A",5000),array("B",8000),array("C",400),array("D",40000),array("E",1000),array("F",1400 ));
?>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="x-ua-compatible" content="IE=edge" >
<link rel="stylesheet" href="main.css">
</head>
<body>
<div class="chartContainer">
<div id="piechart" class="piechart">
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
// Load google charts
google.charts.load('current',{'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
// Draw the chart and set the chart values
function drawChart() {
var data = google.visualization.arrayToDataTable( <?php echo json_encode($chartData,JSON_NUMERIC_CHECK); ?>);
// Optional; add a title and set the width and height of the chart
var options = {fontName:'Arial',legend:{position: 'labeled',maxLines:15,alignment:'start'},textStyle: {color: 'black',fontSize: 30},pieHole: 0.4,sliceVisibilityThreshold:0.0,chartArea: {
width: "100%",top: "0%",left: "0%"},};
// Display the chart inside the div> element with id="piechart"
var chart = new google.visualization.PieChart(document.getElementById('piechart'));
chart.draw(data,options);
}
</script>
</div>
</div>
</body>