Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
sanganasrikanth9618 opened this issue Sep 16, 2024 · 1 comment · May be fixed by #20703
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@sanganasrikanth9618
Copy link

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

@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Sep 16, 2024
@helgasoft
Copy link

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.

@Justin-ZS Justin-ZS linked a pull request Jan 23, 2025 that will close this issue
8 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants