Skip to content

The feature of "if category axis min/max set, the other axis can be filtered" broken #15050

@100pah

Description

@100pah

Version

5.0.0

Steps to reproduce

in test case <test/axis-filter-extent.html>

What is expected?

option = {
    xAxis: {
        type: 'category',
        max: 1
    },
    yAxis: {
    },
    series: {
        type: 'bar',
        data: [['a', 22], ['b', 52], ['c', 959]]
    }
};

image

What is actually happening?

image

Reason

This feature is original introduced in #12832 for bar-race, which need only display the top n bars and the value axis extent only calculated b y the displayed bars.

But later it is broken by 03fee21, where this change probably incorrect:

https://github.com/apache/echarts/pull/13045/files#diff-3f57e4d3fde67206138ca3250e9b16d1e80d23bd3c327782cb10cbd0b1354aa4L199

scale.isInExtentRange depends on scale._extent, but scale._extent is not set here, but set later in Grid['update'] (Grid['_updateScale']).

And then in eca59fa , the import of the file defaultAxisExtentFromData.ts is missed, but since the feature is broken, this missing can not be found by visual test.

PENDING

OrdianlScale['isInExtentRange'] seems need to be refactored, because:

  1. It depends on _ticksByOrdinalNumber, which but it is initialized in (1) Grid['update'] (too late) (2) dispatchAction
  2. OrdianlScale['contain'] implements the similar feature but do not use that _ticksByOrdinalNumber converter, it's weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugenThis issue is in English

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions