ok-admin/pages/chart/map2.html

40 lines
1014 B
HTML
Raw Normal View History

2019-05-27 01:24:17 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>折线图</title>
</head>
<body>
<div id="main" style="width: 100%;height:400px;margin-top: 50px;"></div>
<script src="../../lib/echarts/echarts.min.js"></script>
<script type="text/javascript">
// 基于准备好的dom初始化echarts实例
var myChart = echarts.init(document.getElementById('main'));
// 指定图表的配置项和数据
var option = {
title: {
text: '折线图'
},
xAxis: {
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
},
yAxis: {
type: 'value'
},
series: [{
data: [820, 932, 901, 934, 1290, 1330, 1320],
type: 'line'
}]
};
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);
2019-08-25 04:24:23 +00:00
window.addEventListener("resize", function () {
myChart.resize();
});
2019-05-27 01:24:17 +00:00
</script>
</body>
</html>