Skip to content

[Bug] cannot use scale property with type: 'log' #19073

@Gumichocopengin8

Description

@Gumichocopengin8

Version

5.4.3

Link to Minimal Reproduction

https://codesandbox.io/s/vigilant-sun-gcv5ph?file=/src/App.tsx

Steps to Reproduce

  1. set type: 'log' and scale: true in y axis object
yAxis: { type: 'log', scale: true }
  1. I got the following error
Type '{ type: "log"; scale: true; }' is not assignable to type 'YAXisOption | YAXisOption[]'.
  Object literal may only specify known properties, and 'scale' does not exist in type '(AxisBaseOptionCommon & { gridIndex?: number; gridId?: string; position?: CartesianAxisPosition; offset?: number; categorySortInfo?: OrdinalSortInfo; } & { ...; }) | (LogAxisBaseOption & ... 1 more ... & { ...; })'.

echarts.d.ts(10909, 5): The expected type comes from property 'yAxis' which is declared here on type 'EChartsOption'

Current Behavior

I get a type error in Typescript

Expected Behavior

If the scale doc is correct, it should not throw errors

It is available only in numerical axis, i.e., type: 'value'.

I think type : 'log' is also numerical axis

Environment

- OS: macOS
- Browser: Chrome
- Framework: React, Typescript

Any additional comments?

If this error is expected, the doc should be fixed.

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