You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2019/10/25 02:21:56 UTC

[GitHub] [incubator-echarts] Ovilia commented on a change in pull request #11484: Fix #11300

Ovilia commented on a change in pull request #11484: Fix #11300
URL: https://github.com/apache/incubator-echarts/pull/11484#discussion_r338861969
 
 

 ##########
 File path: src/coord/cartesian/Cartesian2D.js
 ##########
 @@ -81,7 +81,15 @@ Cartesian2D.prototype = {
      * @return {boolean}
      */
     containData: function (data) {
-        return this.getAxis('x').containData(data[0])
+        var axisX = this.getAxis('x');
+
+        // For aixs type is category,
+        // only one data shows on viewport just check if it xAxis' value equal to scale
+        if (axisX.type === 'category' && axisX.scale.count() === 1) {
+            return data[0] === axisX.scale._extent[0];
+        }
+
+        return axisX.containData(data[0])
 
 Review comment:
   I'm not sure if you should fix the implementation of `axisX.containData` in the case of one data item. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org