Ovilia commented on code in PR #16947:
URL: https://github.com/apache/echarts/pull/16947#discussion_r1016126877


##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +136,30 @@ const axisElementBuilders: Record<typeof 
selfBuilderAttrs[number], AxisElementBu
             tickModel: splitLineModel
         });
 
+        const axisScale = axis.scale as IntervalScale;
+        if (ticksCoords.length > 2 && axisScale.getInterval) {

Review Comment:
   What if `ticksCoords.length` is `2` but the data range is not equal to the 
ticks' values?



##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +136,30 @@ const axisElementBuilders: Record<typeof 
selfBuilderAttrs[number], AxisElementBu
             tickModel: splitLineModel
         });
 
+        const axisScale = axis.scale as IntervalScale;
+        if (ticksCoords.length > 2 && axisScale.getInterval) {
+            const interval = axisScale.getInterval() || null;
+
+            const showMinLine = splitLineModel.get('showMinLine');
+            if (showMinLine === false
+                || (showMinLine === 'auto'
+                    && ticksCoords[1].tickValue - ticksCoords[0].tickValue < 
interval

Review Comment:
   Have you tested the case when `axis.inverse` is `true`? 
`ticksCoords[1].tickValue` may be smaller than `ticksCoords[0].tickValue` in 
this case.



##########
test/axis-interval.html:
##########
@@ -534,8 +540,68 @@ <h1>Test xAxis.axisTick.interval</h1>
 
 
 
+    <script>
+
+        require([

Review Comment:
   Please add more test cases to test boundary situations. You may start with 
the cases in my above questions.



##########
test/axis-interval.html:
##########
@@ -534,8 +540,68 @@ <h1>Test xAxis.axisTick.interval</h1>
 
 
 
+    <script>
+
+        require([

Review Comment:
   Please add more test cases to test boundary situations. You may start with 
the cases in my above questions.



##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +136,30 @@ const axisElementBuilders: Record<typeof 
selfBuilderAttrs[number], AxisElementBu
             tickModel: splitLineModel
         });
 
+        const axisScale = axis.scale as IntervalScale;
+        if (ticksCoords.length > 2 && axisScale.getInterval) {
+            const interval = axisScale.getInterval() || null;

Review Comment:
   What is `|| null` for?



##########
src/component/axis/CartesianAxisView.ts:
##########
@@ -135,6 +136,30 @@ const axisElementBuilders: Record<typeof 
selfBuilderAttrs[number], AxisElementBu
             tickModel: splitLineModel
         });
 
+        const axisScale = axis.scale as IntervalScale;
+        if (ticksCoords.length > 2 && axisScale.getInterval) {
+            const interval = axisScale.getInterval() || null;
+
+            const showMinLine = splitLineModel.get('showMinLine');
+            if (showMinLine === false

Review Comment:
   `!showMinLine` should be better.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to