Skip to content

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

@sanganasrikanth9618

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

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions