You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@echarts.apache.org by GitBox <gi...@apache.org> on 2018/04/18 03:11:03 UTC

[GitHub] mohsu opened a new issue #8180: Scatter plot在大量資料下用tooltip會有series消失

mohsu opened a new issue #8180: Scatter plot在大量資料下用tooltip會有series消失
URL: https://github.com/apache/incubator-echarts/issues/8180
 
 
   ### One-line summary [问题简述]
   scatter plot在資料點多時,會因為使用tooltip造成一條series消失(而且只發生在tooltip trigger: 'axis')
   資料點大約有5萬筆(3 series合計),資料點少的時候不會發生這樣的情形,tooltip trigger是item的狀況下也不會有這樣的問題
   
   另外echart.min.js不支持x-axis為時間的scatter plot,換成echart.js才有
   
   
   
   
   ### Version & Environment [版本及环境]
   + ECharts version [ECharts 版本]: echart 4.0.4
   + Browser version [浏览器类型和版本]: Chrome 65.0.3325.181
   + OS Version [操作系统类型和版本]: Windows 1709(16299.371)
   
   
   
   
   
   ### Expected behaviour [期望结果]
   原本有藍、粉紅兩條series
   ![expected](https://user-images.githubusercontent.com/6942882/38908975-2b33a16a-42f5-11e8-917b-9f86aaab2653.png)
   tooltip出現後只剩一條(且不完整)
   ![tooltip](https://user-images.githubusercontent.com/6942882/38908980-30f08514-42f5-11e8-8612-aaca9ebcc561.png)
   
   
   
   
   
   ### ECharts option [ECharts配置项]
   <!-- Copy and paste your 'echarts option' here. -->
   <!-- [下方贴你的option,注意不要删掉下方 ```javascript 和 尾部的 ``` 字样。最好是我们能够直接运行的 option。如何得到能运行的 option 参见上方的 guidelines for contributing] -->
   ```javascript
   option = {
       axisPointer: {
               link: {xAxisIndex: 'all'},
                lineStyle: {
                        type: 'dashed'
                },
                },
                       tooltip: {
                           trigger: 'axis',
                           showDelay : 0,
                           borderWidth: 1,
                           borderColor: '#ccc',
                           formatter: function (params) {
                               //self-defined tooltip format
                               var data_string = "";
                               var time_Date = "";
                               var time = "";
   
                               for (var i = 0; i < params.length; i++) {
                                   if (time === "") {
                                       time = echarts.format.formatTime('hh:mm:ss', new Date(params[0].value[0]));
                                       time_Date = echarts.format.formatTime('dd/MM/yyyy hh:mm:ss', new Date(params[0].value[0]));
                                   }
                                       data_string += '<span style="display:inline-block;margin-right:5px;border-radius:10px;width:9px;height:9px;background-color:' + params[i].color + '">'+'</span>'+  params[i].seriesName +  " : " + params[i].value[1] + "(" + params[i].value[2]  + ")</br>";
                               }
                               return time + "</br>" + data_string;
                           },
                       }, //end of tooltip
                       animation: false, 
                       grid: [{
                           left: '5%',
                           right: '3%',
                           height: '60%',
                           z: 1
                       }, {
                           left: '5%',
                           right: '3%',
                           top: '78%',
                           height: '9%',
                           z: 2
                       }
                       ],
                       xAxis: [{
                           type: 'time',
                           scale: true,
                           show: false,
                           boundaryGap: false,
                           axisLine: {onZero: false},
                           min: new Date('{{ selectiondic.min_time }}'),
                           max: new Date('{{ selectiondic.max_time }}'),
                           axisLabel: {show: false},
                       }, {
                           type: 'time',
                           gridIndex: 1,
                           scale: true,
                           boundaryGap: false,
                           axisLine: {onZero: false},
                           axisTick: {show: false},
                           splitLine: {show: false},
                           axisLabel: {
                               formatter: function (value) {
                                   return echarts.format.formatTime('hh:mm:ss', new Date(value)) + ' \n' + echarts.format.formatTime('dd-MM-yy', new Date(value));
                               }
                           },
                           min: new Date('{{ selectiondic.min_time }}'),
                           max: new Date('{{ selectiondic.max_time }}'),
                       }],
                       yAxis: [{
                           name: 'odds',
                           type: 'value',
                           scale: true,
                           axisLine: {onZero: false},
                           splitArea: {
                               show: true
                           }
                       }, {
                           type: 'value',
                           scale: true,
                           gridIndex: 1,
                           splitNumber: 2,
                           axisLine: {show: false},
                           axisTick: {show: false},
                           splitLine: {show: false},
                           axisLabel: {
                               show: false
                           },
                           splitArea: {
                               show: true
                           }
                       }],
                       series: [{{ selectiondic.echart_data | safe}}],
                       dataZoom: [{ //mouse
                           type: 'inside',
                           xAxisIndex: [0, 1]
                       }, { //slider
                           type: 'slider',
                           xAxisIndex: [0, 1],
                           bottom: 5,
                           showDataShadow: true,
                           showDetail: false
                       }],
                       toolbox: {
                           feature: {
                               restore: {
                                   title: "restore",
                               },
                               saveAsImage: {
                                   title: "saveImage"
                               }
                           }
                       },
   }
   
   ```
   
   ### Other comments [其他信息]
   {{ variable }}為django變數
   series: [{
                  type: 'scatter',
                  data: %s,
                  symbolSize: 4,
                  animation: false,
                  large: true,
                  largeThreshold: 3000,
      }% getXYZ()]

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org