话不多说,老规矩,先上图,实现echarts实现散点图,x轴数据为时间年月日。
实现代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>五分钟上手之散点图</title>
<!-- 引入 echarts.js -->
<script src="js/echarts.min.js"></script>
<script src="js/jquery-1.11.3.js"></script>
</head>
<body>
<!-- 为ECharts准备一个具备大小(宽高)的Dom -->
<div style="height: 500px; 1000px;" id="Scatter"></div>
<script type="text/javascript">
$(document).ready(function() {
var MyScatter = echarts.init(document.getElementById('Scatter'));
var data = [
['2012-03-01',
1,
"翻身"
],
[
'2013-06-01',
0.5,
"没翻身"
],
[
'2017-03-02',
0.5,
"翻身"
]
];
var textStyle = {
color: '#333',
fontStyle: 'normal',
fontWeight: 'normal',
fontFamily