Skip to content

[Feature] 类目标签支持自动检测标签长度而选择标签倾斜显示 #18664

Description

@mtrdong

What problem does this feature solve?

有时类目的数量,或着类目名称都可能时变化的。例如统计学生们对每节各个知识点的掌握情况,其中知识点作为X轴类目,名称和数量都是变化的。我希望显示所有知识点,又不想它们重叠,这时就需要自动检测知识点名称的长度,设置名称过长时的显示方式。而不是只能设置倾斜显示,或者使用回调函数。这样将显得更加智能和人性化,体验更好

What does the proposed API look like?

当设置xAxis.axisLabel.interval=0时,毫无疑问,我们是不可能希望标签名称重叠的。这时要么设置xAxis.axisLabel.rotate使标签始终倾斜显示,要么通过回调函数换行标签名称,大多数人也是这么做的,这样的体验并不好,也许我们可以允许设置xAxis.axisLabel.rotate='auto',当设置xAxis.axisLabel.interval=0xAxis.axisLabel.rotate='auto'时,如果标签名称过长,默认按45度倾斜显示;当设置xAxis.axisLabel.interval=0且使用了回调函数,则在参数中加入标签是否过长的标识。如此一来,对于类目标签名称的处理将更加灵活

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-featurependingWe are not sure about whether this is a bug/new feature.staleInactive for a long time. Will be closed in 7 days.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions