我尝试在 echarts 4.1.0 版中编写一个折线图。我使用不同的浏览器,如 Chrome 版本 69.0.3497.100 或 Firefox 63.0.1(64 位)。我的问题是,如果我缩放 x 轴,如果点在焦点之外,连接线就会消失:
这就是我的这个例子的代码:
<html>
<head>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/echarts/4.1.0-release/echarts-en.min.js"></script>
</head>
<body>
<div id="main_chart" style="width: 1200px;height:600px;"></div>
<script type="text/javascript">
// based on prepared DOM, initialize echarts instance
var myChart = echarts.init(document.getElementById('main_chart'));
var app = {};
option = null;
option = {
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross'
}
},
xAxis: {
type: 'time',
axisLabel: {
formatter: function (value) {
return echarts.format.formatTime('yyyy-MM-dd hh:mm:ss', value);
}
}
},
yAxis: {
type: 'value', …Run Code Online (Sandbox Code Playgroud)