Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] axis's onZero can not work in hotizontal bar #2099

Closed
kkxxkk2019 opened this issue Jan 22, 2024 · 0 comments · Fixed by #2100
Closed

[Bug] axis's onZero can not work in hotizontal bar #2099

kkxxkk2019 opened this issue Jan 22, 2024 · 0 comments · Fixed by #2100
Assignees
Labels
bug Something isn't working
Milestone

Comments

@kkxxkk2019
Copy link
Collaborator

Version

latest

Link to Minimal Reproduction

none

Steps to Reproduce

  const spec = {
    direction: 'horizontal',
    type: 'common',
    color: [
      '#61BA95',
      '#335B4A',
      '#7A94BF',
      '#2E5599',
      '#B9A582',
      '#735A40',
      '#BC9B44',
      '#99533D',
      '#809E9D',
      '#2E8582'
    ],
    series: [
      {
        type: 'bar',
        stack: true,
        direction: 'horizontal',
        bar: {
          state: {
            hover: {
              stroke: '#000',
              lineWidth: 1
            }
          }
        },
        label: {
          visible: true,
          position: 'inside',
          style: {
            lineHeight: '100%'
          },
          overlap: true,
          smartInvert: true
        },
        totalLabel: {
          visible: true,
          position: 'top',
          overlap: false,
          style: {
            lineHeight: '100%'
          }
        },
        xField: '_editor_value_field',
        yField: '_editor_dimension_field',
        dataId: '0',
        seriesField: '_editor_type_field'
      }
    ],
    legends: {
      id: 'legend-discrete',
      visible: true,
      autoPage: false,
      position: 'start',
      interactive: false
    },
    region: [
      {
        id: 'region-0',
        style: {}
      }
    ],
    tooltip: {
      visible: true
    },
    axes: [
      {
        orient: 'left',
        id: 'axis-left',
        type: 'band',
        label: {
          autoLimit: false
        },
        maxWidth: null,
        maxHeight: null,
        trimPadding: false,
        domainLine: {
          onZero: true
        }
      },
      {
        orient: 'bottom',
        id: 'axis-bottom',
        type: 'linear',
        label: {
          autoLimit: false,
          formatMethod: null
        },
        maxWidth: null,
        maxHeight: null
      }
    ],
    data: [
      {
        id: '0',
        sourceKey: 'total',
        values: [
          {
            _editor_dimension_field: 'x1',
            _editor_value_field: 20,
            _editor_type_field: 'a'
          },
          {
            _editor_dimension_field: 'x2',
            _editor_value_field: -23,
            _editor_type_field: 'a'
          },
          {
            _editor_dimension_field: 'x3',
            _editor_value_field: 26,
            _editor_type_field: 'a'
          },
          {
            _editor_dimension_field: 'x1',
            _editor_value_field: 20,
            _editor_type_field: 'b'
          },
          {
            _editor_dimension_field: 'x2',
            _editor_value_field: 24,
            _editor_type_field: 'b'
          },
          {
            _editor_dimension_field: 'x3',
            _editor_value_field: 29,
            _editor_type_field: 'b'
          }
        ]
      }
    ],
    width: 640,
    height: 360,
    background: 'transparent'
  };

Current Behavior

NA

Expected Behavior

NA

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

@kkxxkk2019 kkxxkk2019 added the bug Something isn't working label Jan 22, 2024
@kkxxkk2019 kkxxkk2019 self-assigned this Jan 22, 2024
@kkxxkk2019 kkxxkk2019 added this to the v1.8.9 milestone Jan 22, 2024
@kkxxkk2019 kkxxkk2019 mentioned this issue Jan 22, 2024
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant