echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] visualMap 中的pieces不支持渐变色

Open ForeseeBear opened this issue 4 years ago • 4 comments

What problem does this feature solve?

在很多场景下需要visualMap 中的颜色是渐变,如预警满足条件高亮,虽然系列中的data组装成数组对象设置渐变色能达到,但是对于这种方式显示很不方便

What does the proposed API look like?

visualMap: [ { type: 'piecewise ', pieces: [ { value: 123, label: '123(自定义特殊颜色)', color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: 'red' // 0% 处的颜色 }, { offset: 1, color: 'blue' // 100% 处的颜色 }], global: false // 缺省为 false } }, { outOfRange: { color: { type: 'radial', x: 0.5, y: 0.5, r: 0.5, colorStops: [{ offset: 0, color: 'red' // 0% 处的颜色 }, { offset: 1, color: 'blue' // 100% 处的颜色 }], global: false // 缺省为 false } } } ] } ]

ForeseeBear avatar Jan 22 '22 03:01 ForeseeBear

@ForeseeBear It seems you are not using English, I've helped translate the content automatically. To make your issue understood by more people and get helped, we'd like to suggest using English next time. 🤗

TRANSLATED

TITLE

[Feature] Pieces in visualMap do not support gradients

BODY

What problem does this feature solve?

In many scenarios, the color in visualMap needs to be gradient. For example, if the warning meets the conditions, it is highlighted. Although the data in the series is assembled into an array object to set the gradient color, it is very inconvenient to display in this way.

What does the proposed API look like?

visualMap: [ { type: 'piecewise ', pieces: [ { value: 123, label: '123 (custom special color)', color: { type: 'linear', x: 0, y: 0, x2: 0, y2: 1, colorStops: [{ offset: 0, color: 'red' // color at 0% }, { offset: 1, color: 'blue' // color at 100% }], global: false // default is false } }, { outOfRange: { color: { type: 'radial', x: 0.5, y: 0.5, r: 0.5, colorStops: [{ offset: 0, color: 'red' // color at 0% }, { offset: 1, color: 'blue' // color at 100% }], global: false // default is false } } } ] } ]

echarts-bot[bot] avatar Jan 22 '22 03:01 echarts-bot[bot]

Related to https://github.com/apache/echarts/issues/8034 and https://github.com/apache/echarts/issues/14959. I'm personally also very much interested in seeing a solution for this.

steve2507 avatar Aug 04 '22 09:08 steve2507

It would also be useful for attributes like areaStyle.

jessicah avatar Aug 02 '23 02:08 jessicah