Created
October 18, 2018 14:11
-
-
Save mcmoe/ef61c899096a6bb1ceb1daa7f633d4ed to your computer and use it in GitHub Desktop.
How to create a Linear Gradient color in echarts 4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ... | |
const color = this._colors[i % this._colors.length]; | |
const colorNext = echarts.color.lift(color, 0.3); | |
return { | |
type: 'linear', | |
x: 0, | |
y: 1, | |
x2: 0, | |
y2: 0, | |
colorStops: [{ | |
offset: 0, color: color // color at 0% position | |
}, { | |
offset: 1, color: colorNext // color at 100% position | |
}], | |
globalCoord: false // false by default | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment