这是我在下面绘制图形的 HTML 文件。当我使用 IE/Firefox/Chrome 打开我的 HTML 文件时,我可以正确地看到我的图表。
我需要在电子邮件正文中发送此图表。当我尝试使用以下命令时,我只能看到此 HTML 的纯文本版本:
mail -r techgeeky@domain.com < graph.html
所以我修改了我的文件,graph.html,如下所示,在顶部添加了几行。然后当我再次触发上述命令时,我的邮件正文中什么也没有。我需要在电子邮件顶部专门添加什么来完成这项工作吗?我正在运行 SunOS 5.10。
From: techgeeky@domain.com
To: techgeeky@domain.com
Subject: MIME Test
Mime-Version: 1.0
Content-type: text/html; charset=utf-8
Content-transfer-encoding: us-ascii
<html>
<head>
<!--Load the AJAX API-->
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
// Load the Visualization API and the piechart package.
google.load('visualization', '1.0', {'packages':['corechart']});
// Set a callback to run when the Google Visualization API is loaded.
google.setOnLoadCallback(drawChart);
// Callback that creates and populates a data table,
// instantiates the pie chart, passes in the data and
// draws it.
function drawChart() {
// Create the data table.
var data = new google.visualization.DataTable();
data.addColumn('string', 'Title');
data.addColumn('number', 'Value');
data.addRows([
['No Error Percentage', 100-16.81336174073654],
['Error Percentage', 16.81336174073654]
]);
// Set chart options
var options = {'title':'LIP Data Quality Report',
'width':700,
'height':600};
// Instantiate and draw our chart, passing in some options.
var chart = new google.visualization.PieChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</head>
<body>
<!--Div that will hold the pie chart-->
<div id="chart_div" style="width:900px; height: 800px;"></div>
</body>
</html>