Skip to content

[Bug] BarChart xAxis using array data #20429

@Ian-HL

Description

@Ian-HL

Version

5.5.1

Link to Minimal Reproduction

https://jsfiddle.net/qk52Lho4/

Steps to Reproduce

my option is :

let productsArray = ['SparrowPjl_XF03_FT_V1.06', 'SparrowPjl_EQC_V1.00', 'DP3254SCA_CHAORENLAC_XF03_FT_V1.01', 'DP3254S_CHAORENLAC_XF02_V1.0.0', 'GEBB_DW01_EQC_V1.03', 'DPM32M031G6P7AB-TSSOP28_XF03_FT_V1.03']
let productDataArray = [10581297,7538574,4052527,2997434,1369484,1222283]
let productRateDataArray = [99,89,79,69,59,49]

const option = {
title: {
text: '产品产量/良率'
},
tooltip: {
trigger: 'axis'
},
legend: {
data: ['产量','良率']
},
xAxis: [ // 交换 X 轴和 Y 轴
{
type: 'value', // 将 X 轴类型改为 'value'
name: '产量',
gap: [0, 0.01],
axisLabel: {
formatter: '{value}'
}
},
{
type: 'value',
name: '良率',
min: 0,
max: 100,
axisLabel: {
formatter: '{value}%'
}
}
],
yAxis: [ // 交换 Y 轴和 X 轴
{
type: 'category', // 将 Y 轴类型改为 'category'
data: productsArray, // 使用 products 作为 Y 轴的数据
axisLabel: {
formatter: function (value) {
const maxLength = 10;
return value.length > maxLength ? value.substring(0, maxLength) + '...' : value;
}
}
}
],
series: [
{
name: '产量',
type: 'bar',
data: productDataArray
},
{
name: '良率',
type: 'bar',
data: productRateDataArray
}
]
}

Current Behavior

“良率” is not show in the chart . Because it's using '产量''s coordinate . In that coordinate <100 is small number so it invisible in the chart .

Expected Behavior

“良率” should use itself's coordinate . so it value can be seen in the chart .

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions