This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/echarts.git


The following commit(s) were added to refs/heads/master by this push:
     new aec053d  fix(sankey): gradient should follow orient
     new 8f0d8d7  Merge pull request #15363 from 
susiwen8/sankey-linecolor-vertical
aec053d is described below

commit aec053d93095fef4afcef969fb6e7529a0f3e5dd
Author: susiwen8 <[email protected]>
AuthorDate: Thu Jul 15 23:32:00 2021 +0800

    fix(sankey): gradient should follow orient
---
 src/chart/sankey/SankeyView.ts |  2 +-
 test/sankey.html               | 13 ++++++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/chart/sankey/SankeyView.ts b/src/chart/sankey/SankeyView.ts
index 480aeb5..2ef69d7 100644
--- a/src/chart/sankey/SankeyView.ts
+++ b/src/chart/sankey/SankeyView.ts
@@ -207,7 +207,7 @@ class SankeyView extends ChartView {
                     const sourceColor = edge.node1.getVisual('color');
                     const targetColor = edge.node2.getVisual('color');
                     if (typeof sourceColor === 'string' && typeof targetColor 
=== 'string') {
-                        curve.style.fill = new graphic.LinearGradient(0, 0, 1, 
0, [{
+                        curve.style.fill = new graphic.LinearGradient(0, 0, 
+(orient === 'horizontal'), +(orient === 'vertical'), [{
                             color: sourceColor,
                             offset: 0
                         }, {
diff --git a/test/sankey.html b/test/sankey.html
index 74091be..777255d 100644
--- a/test/sankey.html
+++ b/test/sankey.html
@@ -70,7 +70,18 @@ under the License.
                                 color: 'gradient',
                                 curveness: 0.5
                             }
-                        }
+                        },
+                        {
+                            orient: 'vertical',
+                            type: 'sankey',
+                            focusNodeAdjacency: true,
+                            data: data.nodes,
+                            links: data.links,
+                            lineStyle: {
+                                color: 'gradient',
+                                curveness: 0.5
+                            }
+                        },
                     ]
                 });
             });

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

Reply via email to