Skip to content

Add selected state style for toolbox magicType buttons #21672

Description

@lingdang1007

What problem does this feature solve?

目前 magicType 只有 normal 和 emphasis 两种状态
初始化时无法为默认选中的图标设置颜色,如果需要修改颜色只能所有的图标颜色都一起修改
无法为当前选中的类型设置不同颜色
希望能像 series 一样支持 selected 状态样式

What does the proposed API look like?

magicType: {
type: ['line', 'bar'],
// 每个类型的默认样式
iconStyle: {
line: { color: '#0FBF98' }, // 折线图:绿色
bar: { color: '#333333' } // 柱状图:灰色
},
// 或者用 selected 状态
selectedIconStyle: {
color: '#0FBF98' // 当前选中类型:绿色
},
normalIconStyle: {
color: '#333333' // 未选中类型:灰色
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-featurependingWe 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