Skip to content

[Bug] Overflow property missing from AxisNameTextStyleOption type #20010

Description

@mkf62

Version

5.5.0

Link to Minimal Reproduction

https://codesandbox.io/p/sandbox/echarts-overflow-property-typescript-problem-fkp73v?file=%2Fsrc%2FchartOptions.ts%3A142%2C11

Steps to Reproduce

  1. Create a project using echarts 5.5.0 and typescript 4.4.0+
  2. Configure a chart with yAxis.nameTextStyle.overflow set to anything
  3. Hover over the red squiggly that will appear under overflow: <value> and view the error message

Current Behavior

In the code sandbox attached, you can view the behavior in the chartOptions.ts file (scroll down below all the data - I copied a graph directly from the eCharts demo tabs and just added the necessary code to the yAxis to recreate the error).

When you follow the steps above, you will receive a typescript warning that the overflow property is not part of the AxisNameTextStyleOption type. Meanwhile the documentation states that it should be a valid property: docs

Type '{ width: number; overflow: string; }' is not assignable to type 'AxisNameTextStyleOption'.
  Object literal may only specify known properties, and 'overflow' does not exist in type 'AxisNameTextStyleOption'.typescript(2322)
echarts.d.ts(2389, 5): The expected type comes from property 'nameTextStyle' which is declared here on type 'YAXisOption'

Expected Behavior

I should be able to define the overflow property as part of the nameTextStyle object without TypeScript errors.

Environment

- OS: macOS Ventura 
- Browser: Chrome latest version
- Framework: NextJS 14.1.3

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.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