镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Unable to apply a single visual map configuration to multiple series in charts when using the dataset approach. #20347

Closed

Description

@sanganasrikanth9618

Version

5.5.1

Link to Minimal Reproduction

https://codepen.io/Srikanth-Sangana/pen/vYqwaxK

Steps to Reproduce

Created a chart using the options below, following the dataset approach:

var dom = document.getElementById('chart-container');
var myChart = echarts.init(dom, null, {
renderer: 'canvas',
useDirtyRect: false
});
var app = {};

var option;
option = {
textStyle: {
fontFamily: 'OpenSans-Regular'
},
grid: {
left: 74,
right: 6,
bottom: 58,
top: 50,
containLabel: true
},
visualMap: {
type: 'piecewise',
pieces: [
{ gt: 0, lte: 2000, color: '#93CE07' },
{ gt: 2001, lte: 2500, color: '#FBDB0F' },
{ gt: 2501, color: '#FD0100' }
],
outOfRange: {
color: ' #808080'
},
seriesIndex: [0, 1]
},
yAxis: {
name: 'Measures',
type: 'value',
min: 0,
max: 4000,
interval: 250
},
series: [
{
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
name: 'series_1',
label: {
show: true
},
},
{
type: 'line',
xAxisIndex: 0,
yAxisIndex: 0,
name: 'series_2',
label: {
show: true
},
}
],
dataset: [
{
dimensions: [
'chainname_desc',
'series_1',
'series_2'
],
source: [
{
chain: 'NCC2456',
series_1: 1020,
series_2: 1150,
chainname_desc: 'CHAIN ONE'
},
{
chain: 'NCC3569',
series_1: 2700,
series_2: 2300,
chainname_desc: 'CHAIN TWO'
},
{
chain: 'NCC7845',
series_1: 3500,
series_2: 3100,
chainname_desc: 'CHAIN THREE'
}
]
}
],
legend: {
type: 'scroll',
show: true,
data: ['series_1', 'series_2'],
bottom: 0,
left: 'center',
width: 1130,
},
xAxis: {
data: ['CHAIN ONE', 'CHAIN TWO', 'CHAIN THREE'],
name: 'Chain',
type: 'category',
}
};

if (option && typeof option === 'object') {
myChart.setOption(option);
}

window.addEventListener('resize', myChart.resize);

Current Behavior

Current

Currently, the visual map is not applied to all series, even though the seriesIndex includes all the series in the array.

Expected Behavior

The single visual map configuration should apply to multiple series in the dataset approach that we followed.

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

Activity

  1. added
    enThis issue is in English
    pendingWe are not sure about whether this is a bug/new feature.
    on Sep 16, 2024
  2. helgasoft commented on Sep 16, 2024

    @helgasoft

    agree, visualMap works fine with series-line.data, but has a bug with dataset - Demo.
    This is a variation(duplicate) of a known bug #19270. In the example above dimension:1 is equivalent to the second row of dataset.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in EnglishpendingWe are not sure about whether this is a bug/new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions