提交 c8c5a15e 编写于 作者: S SHUANG SU 提交者: sushuang

fix:

(1) Fix that tooltip shows multiple values around both sides of the pointer. Fix #9829.
(2) Fix a probably typo (diff < maxDistance) introduced by https://github.com/apache/incubator-echarts/commit/4ef66e1d892485ced1dbfcf915135e7740bb7cc3
(3) Remove the previous logic to resolve #2869. Because currently if there are multiple values on the same axis tick, both of them will be found and displayed in tooltip by default. The related historical commits:
https://github.com/apache/incubator-echarts/commit/60d341f4ed9e33381099624962a8388eef8a9547  (fix #2869)
https://github.com/apache/incubator-echarts/commit/3426bd0e544b16f90a476cd36a79119c3570a63b  (support find multiple values on the same axis tick).
上级 ac941880
......@@ -1159,23 +1159,31 @@ listProto.indicesOfNearest = function (dim, value, maxDistance) {
maxDistance = Infinity;
}
var minDist = Number.MAX_VALUE;
var minDist = Infinity;
var minDiff = -1;
var nearestIndicesLen = 0;
for (var i = 0, len = this.count(); i < len; i++) {
var diff = value - this.get(dim, i /*, stack */);
var diff = value - this.get(dim, i);
var dist = Math.abs(diff);
if (diff <= maxDistance && dist <= minDist) {
// For the case of two data are same on xAxis, which has sequence data.
// Show the nearest index
// https://github.com/ecomfe/echarts/issues/2869
if (dist < minDist || (diff >= 0 && minDiff < 0)) {
if (dist <= maxDistance) {
// When the `value` is at the middle of `this.get(dim, i)` and `this.get(dim, i+1)`,
// we'd better not push both of them to `nearestIndices`, otherwise it is easy to
// get more than one item in `nearestIndices` (more specifically, in `tooltip`).
// So we chose the one that `diff >= 0` in this csae.
if (dist < minDist
|| (dist === minDist && diff >= 0 && minDiff < 0)
) {
minDist = dist;
minDiff = diff;
nearestIndices.length = 0;
nearestIndicesLen = 0;
}
if (diff === minDiff) {
nearestIndices[nearestIndicesLen++] = i;
}
nearestIndices.push(i);
}
}
nearestIndices.length = nearestIndicesLen;
return nearestIndices;
};
......
......@@ -128,6 +128,7 @@
"toolbox-tooltip": 1,
"tooltip": 10,
"tooltip-axisPointer": 20,
"tooltip-axisPointer2": 1,
"tooltip-cascade": 4,
"tooltip-event": 1,
"tooltip-link": 2,
......
[{"name":"Action 1","ops":[{"type":"mousemove","time":530,"x":31,"y":450},{"type":"mousemove","time":736,"x":57,"y":450},{"type":"mousemove","time":959,"x":82,"y":449},{"type":"mousemove","time":1163,"x":92,"y":447},{"type":"mousemove","time":1389,"x":93,"y":447},{"type":"mousemove","time":1634,"x":93,"y":447},{"type":"mousemove","time":1835,"x":114,"y":448},{"type":"mousemove","time":2051,"x":131,"y":448},{"type":"mousemove","time":2278,"x":142,"y":448},{"type":"mousemove","time":2522,"x":145,"y":447},{"type":"mousemove","time":3210,"x":148,"y":447},{"type":"mousemove","time":3428,"x":155,"y":445},{"type":"mousemove","time":3631,"x":156,"y":445},{"type":"mousemove","time":3834,"x":164,"y":445},{"type":"mousemove","time":4048,"x":183,"y":442},{"type":"mousemove","time":4251,"x":212,"y":439},{"type":"mousemove","time":4459,"x":221,"y":439},{"type":"mousemove","time":4662,"x":222,"y":439},{"type":"mousemove","time":4803,"x":224,"y":439},{"type":"mousemove","time":5005,"x":256,"y":435},{"type":"mousemove","time":5209,"x":281,"y":433},{"type":"mousemove","time":5411,"x":303,"y":433},{"type":"mousemove","time":5718,"x":307,"y":433},{"type":"mousemove","time":5933,"x":328,"y":431},{"type":"mousemove","time":6147,"x":352,"y":430},{"type":"mousemove","time":6373,"x":360,"y":430},{"type":"mousemove","time":6605,"x":361,"y":430},{"type":"mousemove","time":6949,"x":361,"y":430},{"type":"mousemove","time":7182,"x":374,"y":430},{"type":"mousemove","time":7404,"x":401,"y":430},{"type":"mousemove","time":7642,"x":402,"y":430},{"type":"mousemove","time":7821,"x":405,"y":430},{"type":"mousemove","time":8024,"x":418,"y":430},{"type":"mousemove","time":8251,"x":430,"y":430},{"type":"mousemove","time":8674,"x":434,"y":430},{"type":"mousemove","time":8903,"x":448,"y":431},{"type":"mousemove","time":9104,"x":498,"y":424},{"type":"mousemove","time":9330,"x":506,"y":424},{"type":"mousemove","time":9773,"x":511,"y":424},{"type":"mousemove","time":9995,"x":523,"y":426},{"type":"mousemove","time":10207,"x":543,"y":424},{"type":"mousemove","time":10415,"x":570,"y":422},{"type":"mousemove","time":10649,"x":577,"y":422},{"type":"mousemove","time":10921,"x":581,"y":422},{"type":"mousemove","time":11149,"x":645,"y":419},{"type":"mousemove","time":11375,"x":646,"y":418}],"scrollY":0,"scrollX":0,"timestamp":1573747705006}]
\ No newline at end of file
<!DOCTYPE html>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script src="lib/esl.js"></script>
<script src="lib/config.js"></script>
<script src="lib/jquery.min.js"></script>
<script src="lib/facePrint.js"></script>
<script src="lib/testHelper.js"></script>
<!-- <script src="ut/lib/canteen.js"></script> -->
<link rel="stylesheet" href="lib/reset.css" />
</head>
<body>
<style>
</style>
<div id="main0"></div>
<div id="main1"></div>
<script>
var option;
require([
'echarts'/*, 'map/js/china' */
], function (echarts) {
const option = {
"animation": false,
"yAxis": [{
}],
"xAxis": [{
"type": "time",
}],
"grid": [{
"left": "50px",
"top": "40px",
"right": "30px",
"bottom": "40px"
}],
"series": [{
"showSymbol": false,
"type": "line",
"data": [
[1552446961000, 100],
[1552446976000, 100],
[1552446991000, 100],
[1552447006000, 100],
[1552447021000, 100],
[1552447036000, 100],
[1552447051000, 100],
[1552447066000, 100],
[1552447081000, 100],
[1552447096000, 100],
[1552447111000, 100],
[1552447126000, 100],
[1552447141000, 100],
[1552447156000, 100],
[1552447171000, 100],
[1552447186000, 100],
[1552447201000, 100],
[1552447216000, 100],
[1552447231000, 100],
[1552447246000, 100],
[1552447261000, 100],
[1552447276000, 100],
[1552447291000, 100],
[1552447306000, 100],
[1552447321000, 100],
[1552447336000, 100],
[1552447351000, 100],
[1552447366000, 100],
[1552447381000, 100],
[1552447396000, 100],
[1552447411000, 100],
[1552447426000, 100],
[1552447441000, 100],
[1552447456000, 100],
[1552447471000, 100],
[1552447486000, 100],
[1552447501000, 100],
[1552447516000, 100],
[1552447531000, 100],
[1552447546000, 100],
[1552447561000, 100],
[1552447576000, 100],
[1552447591000, 100],
[1552447606000, 100],
[1552447621000, 100],
[1552447636000, 100],
[1552447651000, 100],
[1552447666000, 100],
[1552447681000, 100],
[1552447696000, 100],
[1552447711000, 100],
[1552447726000, 100],
[1552447741000, 100],
[1552447756000, 100],
[1552447771000, 100],
[1552447786000, 100],
[1552447801000, 100],
[1552447816000, 100],
[1552447831000, 100],
[1552447846000, 100],
[1552447861000, 100],
[1552447876000, 100],
[1552447891000, 100],
[1552447906000, 100],
[1552447921000, 100],
[1552447936000, 100],
[1552447951000, 100],
[1552447966000, 100],
[1552447981000, 100],
[1552447996000, 100],
[1552448011000, 100],
[1552448026000, 100],
[1552448041000, 100],
[1552448056000, 100],
[1552448071000, 100],
[1552448086000, 100],
[1552448101000, 100],
[1552448116000, 100],
[1552448131000, 100],
[1552448146000, 100],
[1552448161000, 100],
[1552448176000, 100],
[1552448191000, 100],
[1552448206000, 100],
[1552448221000, 100],
[1552448236000, 100],
[1552448251000, 100],
[1552448266000, 100],
[1552448281000, 100],
[1552448296000, 100],
[1552448311000, 100],
[1552448326000, 100],
[1552448341000, 100],
[1552448356000, 100],
[1552448371000, 100],
[1552448386000, 100],
[1552448401000, 100],
[1552448416000, 100],
[1552448431000, 100],
[1552448446000, 100],
[1552448461000, 100],
[1552448476000, 100],
[1552448491000, 100],
[1552448506000, 100],
[1552448521000, 100],
[1552448536000, 100],
[1552448551000, 100],
[1552448566000, 100],
[1552448581000, 100],
[1552448596000, 100],
[1552448611000, 100],
[1552448626000, 100],
[1552448641000, 100],
[1552448656000, 100],
[1552448671000, 100],
[1552448686000, 100],
[1552448701000, 100],
[1552448716000, 100],
[1552448731000, 100],
[1552448746000, 100],
[1552448761000, 100],
[1552448776000, 100],
[1552448791000, 100],
[1552448806000, 100],
[1552448821000, 100],
[1552448836000, 100],
[1552448851000, 100],
[1552448866000, 100],
[1552448881000, 100],
[1552448896000, 100],
[1552448911000, 100],
[1552448926000, 100],
[1552448941000, 100],
[1552448956000, 100],
[1552448971000, 100],
[1552448986000, 100],
[1552449001000, 100],
[1552449016000, 100],
[1552449031000, 100],
[1552449046000, 100],
[1552449061000, 100],
[1552449076000, 100],
[1552449091000, 100],
[1552449106000, 100],
[1552449121000, 100],
[1552449136000, 100],
[1552449151000, 100],
[1552449166000, 100],
[1552449181000, 100],
[1552449196000, 100],
[1552449211000, 100],
[1552449226000, 100],
[1552449241000, 100],
[1552449256000, 100],
[1552449271000, 100],
[1552449286000, 100],
[1552449301000, 100],
[1552449316000, 100],
[1552449331000, 100],
[1552449346000, 100],
[1552449361000, 100],
[1552449376000, 100],
[1552449391000, 100],
[1552449406000, 100],
[1552449421000, 100],
[1552449436000, 100],
[1552449451000, 100],
[1552449466000, 100],
[1552449481000, 100],
[1552449496000, 100],
[1552449511000, 100],
[1552449526000, 100],
[1552449541000, 100],
[1552449556000, 100],
[1552449571000, 100],
[1552449586000, 100],
[1552449601000, 100],
[1552449616000, 100],
[1552449631000, 100],
[1552449646000, 100],
[1552449661000, 100],
[1552449676000, 100],
[1552449691000, 100],
[1552449706000, 100],
[1552449721000, 100],
[1552449736000, 100],
[1552449751000, 100],
[1552449766000, 100],
[1552449781000, 100],
[1552449796000, 100],
[1552449811000, 100],
[1552449826000, 100],
[1552449841000, 100],
[1552449856000, 100],
[1552449871000, 100],
[1552449886000, 100],
[1552449901000, 100],
[1552449916000, 100],
[1552449931000, 100],
[1552449946000, 100],
[1552449961000, 100],
[1552449976000, 100],
[1552449991000, 100],
[1552450006000, 100],
[1552450021000, 100],
[1552450036000, 100],
[1552450051000, 100],
[1552450066000, 100],
[1552450081000, 100],
[1552450096000, 100],
[1552450111000, 100],
[1552450126000, 100],
[1552450141000, 100],
[1552450156000, 100],
[1552450171000, 100],
[1552450186000, 100],
[1552450201000, 100],
[1552450216000, 100],
[1552450231000, 100],
[1552450246000, 100],
[1552450261000, 100],
[1552450276000, 100],
[1552450291000, 100],
[1552450306000, 100],
[1552450321000, 100],
[1552450336000, 100],
[1552450351000, 100],
[1552450366000, 100],
[1552450381000, 100],
[1552450396000, 100],
[1552450411000, 100],
[1552450426000, 100],
[1552450441000, 100],
[1552450456000, 100],
[1552450471000, 100],
[1552450486000, 100],
[1552450501000, 100],
[1552450516000, 100],
[1552450531000, 100],
[1552450546000, 100],
[1552450561000, 100]
]
}, {
"showSymbol": false,
"type": "line",
"data": [
[1552446961000, 0],
[1552446976000, 0],
[1552446991000, 0],
[1552447006000, 0],
[1552447021000, 0],
[1552447036000, 0],
[1552447051000, 0],
[1552447066000, 0],
[1552447081000, 0],
[1552447096000, 0],
[1552447111000, 0],
[1552447126000, 0],
[1552447141000, 0],
[1552447156000, 0],
[1552447171000, 0],
[1552447186000, 0],
[1552447201000, 0],
[1552447216000, 0],
[1552447231000, 0],
[1552447246000, 0],
[1552447261000, 0],
[1552447276000, 0],
[1552447291000, 0],
[1552447306000, 0],
[1552447321000, 0],
[1552447336000, 0],
[1552447351000, 0],
[1552447366000, 0],
[1552447381000, 0],
[1552447396000, 0],
[1552447411000, 0],
[1552447426000, 0],
[1552447441000, 0],
[1552447456000, 0],
[1552447471000, 0],
[1552447486000, 0],
[1552447501000, 0],
[1552447516000, 0],
[1552447531000, 0],
[1552447546000, 0],
[1552447561000, 0],
[1552447576000, 0],
[1552447591000, 0],
[1552447606000, 0],
[1552447621000, 0],
[1552447636000, 0],
[1552447651000, 0],
[1552447666000, 0],
[1552447681000, 0],
[1552447696000, 0],
[1552447711000, 0],
[1552447726000, 0],
[1552447741000, 0],
[1552447756000, 0],
[1552447771000, 0],
[1552447786000, 0],
[1552447801000, 0],
[1552447816000, 0],
[1552447831000, 0],
[1552447846000, 0],
[1552447861000, 0],
[1552447876000, 0],
[1552447891000, 0],
[1552447906000, 0],
[1552447921000, 0],
[1552447936000, 0],
[1552447951000, 0],
[1552447966000, 0],
[1552447981000, 0],
[1552447996000, 0],
[1552448011000, 0],
[1552448026000, 0],
[1552448041000, 0],
[1552448056000, 0],
[1552448071000, 0],
[1552448086000, 0],
[1552448101000, 0],
[1552448116000, 0],
[1552448131000, 0],
[1552448146000, 0],
[1552448161000, 0],
[1552448176000, 0],
[1552448191000, 0],
[1552448206000, 0],
[1552448221000, 0],
[1552448236000, 0],
[1552448251000, 0],
[1552448266000, 0],
[1552448281000, 0],
[1552448296000, 0],
[1552448311000, 0],
[1552448326000, 0],
[1552448341000, 0],
[1552448356000, 0],
[1552448371000, 0],
[1552448386000, 0],
[1552448401000, 0],
[1552448416000, 0],
[1552448431000, 0],
[1552448446000, 0],
[1552448461000, 0],
[1552448476000, 0],
[1552448491000, 0],
[1552448506000, 0],
[1552448521000, 0],
[1552448536000, 0],
[1552448551000, 0],
[1552448566000, 0],
[1552448581000, 0],
[1552448596000, 0],
[1552448611000, 0],
[1552448626000, 0],
[1552448641000, 0],
[1552448656000, 0],
[1552448671000, 0],
[1552448686000, 0],
[1552448701000, 0],
[1552448716000, 0],
[1552448731000, 0],
[1552448746000, 0],
[1552448761000, 0],
[1552448776000, 0],
[1552448791000, 0],
[1552448806000, 0],
[1552448821000, 0],
[1552448836000, 0],
[1552448851000, 0],
[1552448866000, 0],
[1552448881000, 0],
[1552448896000, 0],
[1552448911000, 0],
[1552448926000, 0],
[1552448941000, 0],
[1552448956000, 0],
[1552448971000, 0],
[1552448986000, 0],
[1552449001000, 0],
[1552449016000, 0],
[1552449031000, 0],
[1552449046000, 0],
[1552449061000, 0],
[1552449076000, 0],
[1552449091000, 0],
[1552449106000, 0],
[1552449121000, 0],
[1552449136000, 0],
[1552449151000, 0],
[1552449166000, 0],
[1552449181000, 0],
[1552449196000, 0],
[1552449211000, 0],
[1552449226000, 0],
[1552449241000, 0],
[1552449256000, 0],
[1552449271000, 0],
[1552449286000, 0],
[1552449301000, 0],
[1552449316000, 0],
[1552449331000, 0],
[1552449346000, 0],
[1552449361000, 0],
[1552449376000, 0],
[1552449391000, 0],
[1552449406000, 0],
[1552449421000, 0],
[1552449436000, 0],
[1552449451000, 0],
[1552449466000, 0],
[1552449481000, 0],
[1552449496000, 0],
[1552449511000, 0],
[1552449526000, 0],
[1552449541000, 0],
[1552449556000, 0],
[1552449571000, 0],
[1552449586000, 0],
[1552449601000, 0],
[1552449616000, 0],
[1552449631000, 0],
[1552449646000, 0],
[1552449661000, 0],
[1552449676000, 0],
[1552449691000, 0],
[1552449706000, 0],
[1552449721000, 0],
[1552449736000, 0],
[1552449751000, 0],
[1552449766000, 0],
[1552449781000, 0],
[1552449796000, 0],
[1552449811000, 0],
[1552449826000, 0],
[1552449841000, 0],
[1552449856000, 0],
[1552449871000, 0],
[1552449886000, 0],
[1552449901000, 0],
[1552449916000, 0],
[1552449931000, 0],
[1552449946000, 0],
[1552449961000, 0],
[1552449976000, 0],
[1552449991000, 0],
[1552450006000, 0],
[1552450021000, 0],
[1552450036000, 0],
[1552450051000, 0],
[1552450066000, 0],
[1552450081000, 0],
[1552450096000, 0],
[1552450111000, 0],
[1552450126000, 0],
[1552450141000, 0],
[1552450156000, 0],
[1552450171000, 0],
[1552450186000, 0],
[1552450201000, 0],
[1552450216000, 0],
[1552450231000, 0],
[1552450246000, 0],
[1552450261000, 0],
[1552450276000, 0],
[1552450291000, 0],
[1552450306000, 0],
[1552450321000, 0],
[1552450336000, 0],
[1552450351000, 0],
[1552450366000, 0],
[1552450381000, 0],
[1552450396000, 0],
[1552450411000, 0],
[1552450426000, 0],
[1552450441000, 0],
[1552450456000, 0],
[1552450471000, 0],
[1552450486000, 0],
[1552450501000, 0],
[1552450516000, 0],
[1552450531000, 0],
[1552450546000, 0],
[1552450561000, 0]
]
}, {
"showSymbol": false,
"type": "line",
"data": [
[1552446961000, 50],
[1552446976000, 50],
[1552446991000, 50],
[1552447006000, 50],
[1552447021000, 50],
[1552447036000, 50],
[1552447051000, 50],
[1552447066000, 50],
[1552447081000, 50],
[1552447096000, 50],
[1552447111000, 50],
[1552447126000, 50],
[1552447141000, 50],
[1552447156000, 50],
[1552447171000, 50],
[1552447186000, 50],
[1552447201000, 50],
[1552447216000, 50],
[1552447231000, 50],
[1552447246000, 50],
[1552447261000, 50],
[1552447276000, 50],
[1552447291000, 50],
[1552447306000, 50],
[1552447321000, 50],
[1552447336000, 50],
[1552447351000, 50],
[1552447366000, 50],
[1552447381000, 50],
[1552447396000, 50],
[1552447411000, 50],
[1552447426000, 50],
[1552447441000, 50],
[1552447456000, 50],
[1552447471000, 50],
[1552447486000, 50],
[1552447501000, 50],
[1552447516000, 50],
[1552447531000, 50],
[1552447546000, 50],
[1552447561000, 50],
[1552447576000, 50],
[1552447591000, 50],
[1552447606000, 50],
[1552447621000, 50],
[1552447636000, 50],
[1552447651000, 50],
[1552447666000, 50],
[1552447681000, 50],
[1552447696000, 50],
[1552447711000, 50],
[1552447726000, 50],
[1552447741000, 50],
[1552447756000, 50],
[1552447771000, 50],
[1552447786000, 50],
[1552447801000, 50],
[1552447816000, 50],
[1552447831000, 50],
[1552447846000, 50],
[1552447861000, 50],
[1552447876000, 50],
[1552447891000, 50],
[1552447906000, 50],
[1552447921000, 50],
[1552447936000, 50],
[1552447951000, 50],
[1552447966000, 50],
[1552447981000, 50],
[1552447996000, 50],
[1552448011000, 50],
[1552448026000, 50],
[1552448041000, 50],
[1552448056000, 50],
[1552448071000, 50],
[1552448086000, 50],
[1552448101000, 50],
[1552448116000, 50],
[1552448131000, 50],
[1552448146000, 50],
[1552448161000, 50],
[1552448176000, 50],
[1552448191000, 50],
[1552448206000, 50],
[1552448221000, 50],
[1552448236000, 50],
[1552448251000, 50],
[1552448266000, 50],
[1552448281000, 50],
[1552448296000, 50],
[1552448311000, 50],
[1552448326000, 50],
[1552448341000, 50],
[1552448356000, 50],
[1552448371000, 50],
[1552448386000, 50],
[1552448401000, 50],
[1552448416000, 50],
[1552448431000, 50],
[1552448446000, 50],
[1552448461000, 50],
[1552448476000, 50],
[1552448491000, 50],
[1552448506000, 50],
[1552448521000, 50],
[1552448536000, 50],
[1552448551000, 50],
[1552448566000, 50],
[1552448581000, 50],
[1552448596000, 50],
[1552448611000, 50],
[1552448626000, 50],
[1552448641000, 50],
[1552448656000, 50],
[1552448671000, 50],
[1552448686000, 50],
[1552448701000, 50],
[1552448716000, 50],
[1552448731000, 50],
[1552448746000, 50],
[1552448761000, 50],
[1552448776000, 50],
[1552448791000, 50],
[1552448806000, 50],
[1552448821000, 50],
[1552448836000, 50],
[1552448851000, 50],
[1552448866000, 50],
[1552448881000, 50],
[1552448896000, 50],
[1552448911000, 50],
[1552448926000, 50],
[1552448941000, 50],
[1552448956000, 50],
[1552448971000, 50],
[1552448986000, 50],
[1552449001000, 50],
[1552449016000, 50],
[1552449031000, 50],
[1552449046000, 50],
[1552449061000, 50],
[1552449076000, 50],
[1552449091000, 50],
[1552449106000, 50],
[1552449121000, 50],
[1552449136000, 50],
[1552449151000, 50],
[1552449166000, 50],
[1552449181000, 50],
[1552449196000, 50],
[1552449211000, 50],
[1552449226000, 50],
[1552449241000, 50],
[1552449256000, 50],
[1552449271000, 50],
[1552449286000, 50],
[1552449301000, 50],
[1552449316000, 50],
[1552449331000, 50],
[1552449346000, 50],
[1552449361000, 50],
[1552449376000, 50],
[1552449391000, 50],
[1552449406000, 50],
[1552449421000, 50],
[1552449436000, 50],
[1552449451000, 50],
[1552449466000, 50],
[1552449481000, 50],
[1552449496000, 50],
[1552449511000, 50],
[1552449526000, 50],
[1552449541000, 50],
[1552449556000, 50],
[1552449571000, 50],
[1552449586000, 50],
[1552449601000, 50],
[1552449616000, 50],
[1552449631000, 50],
[1552449646000, 50],
[1552449661000, 50],
[1552449676000, 50],
[1552449691000, 50],
[1552449706000, 50],
[1552449721000, 50],
[1552449736000, 50],
[1552449751000, 50],
[1552449766000, 50],
[1552449781000, 50],
[1552449796000, 50],
[1552449811000, 50],
[1552449826000, 50],
[1552449841000, 50],
[1552449856000, 50],
[1552449871000, 50],
[1552449886000, 50],
[1552449901000, 50],
[1552449916000, 50],
[1552449931000, 50],
[1552449946000, 50],
[1552449961000, 50],
[1552449976000, 50],
[1552449991000, 50],
[1552450006000, 50],
[1552450021000, 50],
[1552450036000, 50],
[1552450051000, 50],
[1552450066000, 50],
[1552450081000, 50],
[1552450096000, 50],
[1552450111000, 50],
[1552450126000, 50],
[1552450141000, 50],
[1552450156000, 50],
[1552450171000, 50],
[1552450186000, 50],
[1552450201000, 50],
[1552450216000, 50],
[1552450231000, 50],
[1552450246000, 50],
[1552450261000, 50],
[1552450276000, 50],
[1552450291000, 50],
[1552450306000, 50],
[1552450321000, 50],
[1552450336000, 50],
[1552450351000, 50],
[1552450366000, 50],
[1552450381000, 50],
[1552450396000, 50],
[1552450411000, 50],
[1552450426000, 50],
[1552450441000, 50],
[1552450456000, 50],
[1552450471000, 50],
[1552450486000, 50],
[1552450501000, 50],
[1552450516000, 50],
[1552450531000, 50],
[1552450546000, 50],
[1552450561000, 50]
]
}, {
"showSymbol": false,
"type": "line",
"data": [
[1552446961000, 200],
[1552446976000, 200],
[1552446991000, 200],
[1552447006000, 200],
[1552447021000, 200],
[1552447036000, 200],
[1552447051000, 200],
[1552447066000, 200],
[1552447081000, 200],
[1552447096000, 200],
[1552447111000, 200],
[1552447126000, 200],
[1552447141000, 200],
[1552447156000, 200],
[1552447171000, 200],
[1552447186000, 200],
[1552447201000, 200],
[1552447216000, 200],
[1552447231000, 200],
[1552447246000, 200],
[1552447261000, 200],
[1552447276000, 200],
[1552447291000, 200],
[1552447306000, 200],
[1552447321000, 200],
[1552447336000, 200],
[1552447351000, 200],
[1552447366000, 200],
[1552447381000, 200],
[1552447396000, 200],
[1552447411000, 200],
[1552447426000, 200],
[1552447441000, 200],
[1552447456000, 200],
[1552447471000, 200],
[1552447486000, 200],
[1552447501000, 200],
[1552447516000, 200],
[1552447531000, 200],
[1552447546000, 200],
[1552447561000, 200],
[1552447576000, 200],
[1552447591000, 200],
[1552447606000, 200],
[1552447621000, 200],
[1552447636000, 200],
[1552447651000, 200],
[1552447666000, 200],
[1552447681000, 200],
[1552447696000, 200],
[1552447711000, 200],
[1552447726000, 200],
[1552447741000, 200],
[1552447756000, 200],
[1552447771000, 200],
[1552447786000, 200],
[1552447801000, 200],
[1552447816000, 200],
[1552447831000, 200],
[1552447846000, 200],
[1552447861000, 200],
[1552447876000, 200],
[1552447891000, 200],
[1552447906000, 200],
[1552447921000, 200],
[1552447936000, 200],
[1552447951000, 200],
[1552447966000, 200],
[1552447981000, 200],
[1552447996000, 200],
[1552448011000, 200],
[1552448026000, 200],
[1552448041000, 200],
[1552448056000, 200],
[1552448071000, 200],
[1552448086000, 200],
[1552448101000, 200],
[1552448116000, 200],
[1552448131000, 200],
[1552448146000, 200],
[1552448161000, 200],
[1552448176000, 200],
[1552448191000, 200],
[1552448206000, 200],
[1552448221000, 200],
[1552448236000, 200],
[1552448251000, 200],
[1552448266000, 200],
[1552448281000, 200],
[1552448296000, 200],
[1552448311000, 200],
[1552448326000, 200],
[1552448341000, 200],
[1552448356000, 200],
[1552448371000, 200],
[1552448386000, 200],
[1552448401000, 200],
[1552448416000, 200],
[1552448431000, 200],
[1552448446000, 200],
[1552448461000, 200],
[1552448476000, 200],
[1552448491000, 200],
[1552448506000, 200],
[1552448521000, 200],
[1552448536000, 200],
[1552448551000, 200],
[1552448566000, 200],
[1552448581000, 200],
[1552448596000, 200],
[1552448611000, 200],
[1552448626000, 200],
[1552448641000, 200],
[1552448656000, 200],
[1552448671000, 200],
[1552448686000, 200],
[1552448701000, 200],
[1552448716000, 200],
[1552448731000, 200],
[1552448746000, 200],
[1552448761000, 200],
[1552448776000, 200],
[1552448791000, 200],
[1552448806000, 200],
[1552448821000, 200],
[1552448836000, 200],
[1552448851000, 200],
[1552448866000, 200],
[1552448881000, 200],
[1552448896000, 200],
[1552448911000, 200],
[1552448926000, 200],
[1552448941000, 200],
[1552448956000, 200],
[1552448971000, 200],
[1552448986000, 200],
[1552449001000, 200],
[1552449016000, 200],
[1552449031000, 200],
[1552449046000, 200],
[1552449061000, 200],
[1552449076000, 200],
[1552449091000, 200],
[1552449106000, 200],
[1552449121000, 200],
[1552449136000, 200],
[1552449151000, 200],
[1552449166000, 200],
[1552449181000, 200],
[1552449196000, 200],
[1552449211000, 200],
[1552449226000, 200],
[1552449241000, 200],
[1552449256000, 200],
[1552449271000, 200],
[1552449286000, 200],
[1552449301000, 200],
[1552449316000, 200],
[1552449331000, 200],
[1552449346000, 200],
[1552449361000, 200],
[1552449376000, 200],
[1552449391000, 200],
[1552449406000, 200],
[1552449421000, 200],
[1552449436000, 200],
[1552449451000, 200],
[1552449466000, 200],
[1552449481000, 200],
[1552449496000, 200],
[1552449511000, 200],
[1552449526000, 200],
[1552449541000, 200],
[1552449556000, 200],
[1552449571000, 200],
[1552449586000, 200],
[1552449601000, 200],
[1552449616000, 200],
[1552449631000, 200],
[1552449646000, 200],
[1552449661000, 200],
[1552449676000, 200],
[1552449691000, 200],
[1552449706000, 200],
[1552449721000, 200],
[1552449736000, 200],
[1552449751000, 200],
[1552449766000, 200],
[1552449781000, 200],
[1552449796000, 200],
[1552449811000, 200],
[1552449826000, 200],
[1552449841000, 200],
[1552449856000, 200],
[1552449871000, 200],
[1552449886000, 200],
[1552449901000, 200],
[1552449916000, 200],
[1552449931000, 200],
[1552449946000, 200],
[1552449961000, 200],
[1552449976000, 200],
[1552449991000, 200],
[1552450006000, 200],
[1552450021000, 200],
[1552450036000, 200],
[1552450051000, 200],
[1552450066000, 200],
[1552450081000, 200],
[1552450096000, 200],
[1552450111000, 200],
[1552450126000, 200],
[1552450141000, 200],
[1552450156000, 200],
[1552450171000, 200],
[1552450186000, 200],
[1552450201000, 200],
[1552450216000, 200],
[1552450231000, 200],
[1552450246000, 200],
[1552450261000, 200],
[1552450276000, 200],
[1552450291000, 200],
[1552450306000, 200],
[1552450321000, 200],
[1552450336000, 200],
[1552450351000, 200],
[1552450366000, 200],
[1552450381000, 200],
[1552450396000, 200],
[1552450411000, 200],
[1552450426000, 200],
[1552450441000, 200],
[1552450456000, 200],
[1552450471000, 200],
[1552450486000, 200],
[1552450501000, 200],
[1552450516000, 200],
[1552450531000, 200],
[1552450546000, 200],
[1552450561000, 200]
]
}],
"tooltip": {
"trigger": "axis",
"confine": true,
transitionDuration: 0,
axisPointer: {
label: {
show: true
}
}
}
};
var chart = testHelper.create(echarts, 'main0', {
title: [
'The auto triggered tooltip tip should alway no two data item from one series.'
],
option: option,
// Should be this width to reproduce the duplicate values
// case in tooltip (by `List.indicesOfNearest`)
width: 688,
height: 200
});
chart.dispatchAction({
type: 'updateAxisPointer',
currTrigger: 'mousemove',
// This point will reproduct the issue #9829 before 4.4.0
x: 411,
y: 130
});
});
</script>
<script>
var option;
require([
'echarts'/*, 'map/js/china' */
], function (echarts) {
var data = [
['1997-10-4', 1],
['1997-10-5', 1],
['1997-10-5', 2],
['1997-10-6', 2],
['1997-10-7', 2],
['1997-10-8', 2],
['1997-10-8', 1],
['1997-10-10', 1],
['1997-10-9', 2],
['1997-10-10', 2],
['1997-10-11', 2],
['1997-10-12', 2],
['1997-10-12', 1],
['1997-10-13', 1],
['1997-10-13', 2]
];
var data2 = [
['1997-10-4', 0.2],
['1997-10-5', 0.2],
['1997-10-6', 0.2],
['1997-10-7', 0.2],
['1997-10-8', 0.2],
['1997-10-9', 0.2],
['1997-10-10', 0.2],
['1997-10-11', 0.2],
['1997-10-12', 0.2],
['1997-10-13', 0.2]
];
var option = {
tooltip: {
trigger: 'axis',
transitionDuration: 0,
axisPointer: {
animation: false
}
},
xAxis: {
type: 'time',
axisPointer: {
snap: false
}
},
yAxis: {
},
series: [{
type: 'line',
data: data
}, {
type: 'line',
data: data2
}]
};
var chart = testHelper.create(echarts, 'main1', {
title: [
'Two pionts on the same xAxis tick, both of them',
'should be displayed in tooltip'
],
option: option,
width: 800,
height: 200
});
});
</script>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册