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

[Feature] Add new positions to series-bar.markLine.data.0.label. position #19685

Closed
isabellachen opened this issue Mar 6, 2024 · 1 comment
Closed
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.

Comments

@isabellachen
Copy link

isabellachen commented Mar 6, 2024

What problem does this feature solve?

When markLines exist very close together on yAxis, it is hard to read.
image

I have tried offsetting vertically with distance and padding but both don't seem to move the label in the vertical axis.

What does the proposed API look like?

Along with label positions: 'start', 'middle', 'end', 'insideStartTop', 'insideStartBottom', 'insideMiddleTop', 'insideMiddleBottom', 'insideEndTop', 'insideEndBottom', to add 'endTop' and 'endBottom'.

option = {
  xAxis: {
    type: 'category',
    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      data: [150, 230, 224, 218, 135, 147, 260],
      type: 'line',
            markLine: {
        data: [
             {
            type: 'test',
            name: 'test',
            yAxis: 197,
            label: {
              backgroundColor: 'pink',
              distance: [20, 300],
              padding: [50,0,0,0]
            }
          },
          {
            type: 'average',
            name: 'Avg',
          }
        ]
      }
    }
  ]
};
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Mar 6, 2024
@isabellachen
Copy link
Author

Use offset instead of distance to manually position the label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
en This issue is in English new-feature pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

1 participant