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 2019/07/09 02:22:59 UTC

[GitHub] [incubator-echarts] shellyaoo opened a new issue #10820: 桑基图linestyle颜色渐变问题

shellyaoo opened a new issue #10820: 桑基图linestyle颜色渐变问题
URL: https://github.com/apache/incubator-echarts/issues/10820
 
 
   Version
   4.2.1
   Steps to reproduce
   linestyle颜色渐变,设置全局的渐变也设置单个渐变
   设置起始值和结束值,从左往右没有问题,
   但是设置成从上往下,颜色渐变就有问题,有些是倒过来的,有些根本没有变,没有按照节点的
   流出方向来设置,直接就是在从左往右进行渐变,不知是全局和单个是否互相影响。
   series数据
    [
          {
   	"type": "sankey",
   	"orient": "vertical",
   	"left": "0",
   	"top": "0",
   	"right": 105,
   	"bottom": "0",
   	"nodeGap": 1,
   	"nodeWidth": 32,
   	"layoutIterations": 0,
   	"focusNodeAdjacency": "allEdges",
   	"draggable": false,
   	"data": [{
   		"name": "长沙",
   		"itemStyle": {
   			"color": "rgba(250,13,13,0.68)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "武汉",
   		"itemStyle": {
   			"color": "rgba(131,15,135,1.00)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "香港",
   		"itemStyle": {
   			"color": "rgba(236,250,145,1.00)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "大不列颠及北爱尔兰联合王国",
   		"itemStyle": {
   			"color": "rgba(230,198,18,1.00)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "台湾",
   		"itemStyle": {
   			"color": "rgba(30,235,82,1.00)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "深圳",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "东京",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "伦敦",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "巴黎",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "柏林",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "新加坡",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "纽约",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "佛罗伦萨",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "意大利",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "威尼斯",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "罗马",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "马尔代夫",
   		"label": {
   			"offset": [0, 0]
   		}
   	}, {
   		"name": "澳门",
   		"itemStyle": {
   			"color": "rgba(250,250,5,1.00)"
   		},
   		"label": {
   			"offset": [0, 0]
   		}
   	}],
   	"links": [{
   		"source": "长沙",
   		"target": "香港",
   		"value": 190,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(250,85,110,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(132,232,232,0.79)"
   				}]
   			}
   		}
   	}, {
   		"source": "长沙",
   		"target": "东京",
   		"value": 50,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(250,85,110,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(132,232,232,0.79)"
   				}]
   			}
   		}
   	}, {
   		"source": "长沙",
   		"target": "伦敦",
   		"value": 20,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(250,85,110,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(132,232,232,0.79)"
   				}]
   			}
   		}
   	}, {
   		"source": "长沙",
   		"target": "巴黎",
   		"value": 10,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(250,85,110,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(132,232,232,0.79)"
   				}]
   			}
   		}
   	}, {
   		"source": "武汉",
   		"target": "香港",
   		"value": 230,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(240,120,230,0.57)"
   				}, {
   					"offset": 1,
   					"color": "rgba(80,168,250,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "武汉",
   		"target": "东京",
   		"value": 180,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(240,120,230,0.57)"
   				}, {
   					"offset": 1,
   					"color": "rgba(80,168,250,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "武汉",
   		"target": "柏林",
   		"value": 70,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(240,120,230,0.57)"
   				}, {
   					"offset": 1,
   					"color": "rgba(80,168,250,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "武汉",
   		"target": "新加坡",
   		"value": 100,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(240,120,230,0.57)"
   				}, {
   					"offset": 1,
   					"color": "rgba(80,168,250,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "香港",
   		"target": "纽约",
   		"value": 80,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(245,123,10,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(230,197,232,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "香港",
   		"target": "伦敦",
   		"value": 230,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(245,123,10,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(230,197,232,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "香港",
   		"target": "巴黎",
   		"value": 100,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(245,123,10,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(230,197,232,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "大不列颠及北爱尔兰联合王国",
   		"target": "佛罗伦萨",
   		"value": 56.99,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(173,240,211,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(207,74,230,0.83)"
   				}]
   			}
   		}
   	}, {
   		"source": "大不列颠及北爱尔兰联合王国",
   		"target": "台湾",
   		"value": 80,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(173,240,211,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(207,74,230,0.83)"
   				}]
   			}
   		}
   	}, {
   		"source": "大不列颠及北爱尔兰联合王国",
   		"target": "意大利",
   		"value": 21,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(173,240,211,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(207,74,230,0.83)"
   				}]
   			}
   		}
   	}, {
   		"source": "大不列颠及北爱尔兰联合王国",
   		"target": "威尼斯",
   		"value": 35,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(173,240,211,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(207,74,230,0.83)"
   				}]
   			}
   		}
   	}, {
   		"source": "台湾",
   		"target": "罗马",
   		"value": 39.34,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(34,240,226,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(240,247,111,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "台湾",
   		"target": "威尼斯",
   		"value": 121,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(34,240,226,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(240,247,111,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "台湾",
   		"target": "马尔代夫",
   		"value": 130,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(34,240,226,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(240,247,111,1.00)"
   				}]
   			}
   		}
   	}, {
   		"source": "深圳",
   		"target": "澳门",
   		"value": 40
   	}, {
   		"source": "香港",
   		"target": "台湾",
   		"value": 40,
   		"lineStyle": {
   			"color": {
   				"type": "linear",
   				"x": 0,
   				"y": 0,
   				"x2": 1,
   				"y2": 1,
   				"colorStops": [{
   					"offset": 0,
   					"color": "rgba(245,123,10,1.00)"
   				}, {
   					"offset": 1,
   					"color": "rgba(230,197,232,1.00)"
   				}]
   			}
   		}
   	}],
   	"label": {
   		"color": "rgba(15,14,14,1.00)",
   		"fontSize": "25",
   		"fontWeight": "bold",
   		"position": "right",
   		"distance": 8,
   		"offset": [0, 0]
   	},
   	"itemStyle": {
   		"borderWidth": 0,
   		"color": "rgba(74,148,217,1.00)"
   	},
   	"lineStyle": {
   		"color": {
   			"type": "linear",
   			"x": 0,
   			"y": 0,
   			"x2": 1,
   			"y2": 1,
   			"colorStops": [{
   				"offset": 0,
   				"color": "rgba(5,85,235,1.00)"
   			}, {
   				"offset": 1,
   				"color": "rgba(121,146,163,0.60)"
   			}]
   		},
   		"curveness": 1,
   		"opacity": 1
   	}
   }
       ]
   What is actually happening?
   颜色渐变没有保持一致
   

----------------------------------------------------------------
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: dev-unsubscribe@echarts.apache.org
For additional commands, e-mail: dev-help@echarts.apache.org