Skip to content

[Bug] dataset.transform并指定fromDatasetIndex无效,始终指向第一个dataset #18176

@Kanglt

Description

@Kanglt

Version

5.4.1

Link to Minimal Reproduction

No response

Steps to Reproduce

var option = {
dataset: [
{
source: [
['Product', 'Sales', 'Price', 'Year'],
['Cake', 123, 32, 2011],
['Dumpling', 341, 25, 2011],
['Biscuit', 122, 29, 2011],
['Tofu', 255, 7, 2012],
['Dumpling', 241, 27, 2012],
['Biscuit', 102, 34, 2012],
['Cake', 153, 28, 2013],
['Dumpling', 281, 31, 2013],
['Biscuit', 92, 39, 2013],
['Cake', 223, 29, 2014],
['Cereal', 211, 17, 2014],
['Tofu', 345, 3, 2014],
]
},
{
source: [
['Product', 'Sales', 'Price', 'Year'],
['Cereal', 231, 14, 2011],
['Tofu', 235, 5, 2011],
['Cake', 143, 30, 2012],
['Cereal', 201, 19, 2012],
['Cereal', 181, 21, 2013],
['Tofu', 395, 4, 2013],
['Dumpling', 211, 35, 2014],
['Biscuit', 72, 24, 2014]
]
},
{
transform: {
type: 'filter',
config: { dimension: 'Year', value: 2011 },
fromDatasetIndex: 1
}
},
{
transform: {
type: 'filter',
config: { dimension: 'Year', value: 2012 }
}
},
{
transform: {
type: 'filter',
config: { dimension: 'Year', value: 2013 }
}
}
],
series: [
{
type: 'pie',
radius: 50,
center: ['25%', '50%'],
datasetIndex: 2
},
{
type: 'pie',
radius: 50,
center: ['50%', '50%'],
datasetIndex: 3
},
{
type: 'pie',
radius: 50,
center: ['75%', '50%'],
datasetIndex: 4
}
]
};

Current Behavior

使用dataset.transform并且指定fromDatasetIndex,发现无论fromDatasetIndex指定的是什么,都一直指向第一个dataset

Expected Behavior

应该是fromDatasetIndex设置指向哪个,数据源就使用哪个

Environment

- OS:Windows 10 企业版 21H2
- Browser: Chrome 108.0.5359.126(正式版本) (64 位)
- Framework:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpendingWe 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