我正在使用嵌入在我的简单 html 代码中的 java 小程序绘制一些 csv 数据。当我没有任何装饰地绘制数据时,事情运行良好;如果我添加标签和标题,我就看不到图表了。我应该在下面报告的 html 代码中更改什么?
<html>
<head>
<script type="text/javascript"
src="dygraph-combined.js"></script>
</head>
<body>
<div id="graphdiv"
style="width:1000px; height:600px;"></div><br>
<script type="text/javascript">
g2 = new Dygraph(
document.getElementById("graphdiv"),
"combined_file.csv", // path to CSV file
{ title: 'Title',
xlabel: 'Time'
ylabel: 'Space',
legend: 'always',
labelsDivStyles: {'textAlign': 'right'},
});
</script>
</body>
</html>
对于绘图选项,我遵循了这个例子。