plainheart commented on a change in pull request #12961:
URL: 
https://github.com/apache/incubator-echarts/pull/12961#discussion_r470505957



##########
File path: src/model/mixin/itemStyle.ts
##########
@@ -54,15 +64,24 @@ class ItemStyleMixin {
         includes?: readonly (keyof ItemStyleOption)[]
     ): ItemStyleProps {
         const style = getItemStyle(this, excludes, includes);
-        const lineDash = this.getBorderLineDash();
-        lineDash && (style.lineDash = lineDash);
+        style.lineDash = this.getBorderLineDash(style.lineWidth);
         return style;
     }
 
-    getBorderLineDash(this: Model): number[] {
+    getBorderLineDash(this: Model, lineWidth?: number): number[] {
         const lineType = this.get('borderType');
-        return (lineType === 'solid' || lineType == null) ? null
-            : (lineType === 'dashed' ? [5, 5] : [1, 1]);
+        if (lineType == null || lineType === 'solid') {
+            return [];
+        }
+
+        lineWidth = lineWidth || 0;
+
+        let dashArray = this.get('borderDashArray');
+        // compatible with single number
+        if (dashArray != null && !isNaN(dashArray)) {
+            dashArray = [+dashArray];
+        }
+        return dashArray || (lineType === 'dashed' ? [5, 5] : [1, 1]);
     }

Review comment:
       That should be feasible and can reduce the options. I'll tweak it later.




----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@echarts.apache.org
For additional commands, e-mail: commits-h...@echarts.apache.org

Reply via email to