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

feat(gauge): axisLabel support angle rotating. close 15944 #16985

Merged
merged 1 commit into from
Aug 9, 2022

Conversation

MeetzhDing
Copy link
Contributor

@MeetzhDing MeetzhDing commented May 5, 2022

Brief Information

This pull request is in the type of:

  • bug fixing
  • new feature
  • others

What does this PR do?

gauge text label rotate. #15944

Details

Before: What was the problem?

gauge text label can`t rotating by angle.

After: How is it fixed in this PR?

add new option: gauge-series.axisLabel.rotating
if true, rotating label by angle.
image
image

Misc

  • The API has been changed (apache/echarts-doc#xxx)

Related test cases or examples to use the new APIs

gauge-case.html
gauge-simple.html

@echarts-bot
Copy link

echarts-bot bot commented May 5, 2022

Thanks for your contribution!
The community will review it ASAP. In the meanwhile, please checkout the coding standard and Wiki about How to make a pull request.

@pissang pissang added this to the 5.3.3 milestone May 5, 2022
@pissang
Copy link
Contributor

pissang commented May 5, 2022

Wow looks great!

@pissang pissang modified the milestones: 5.3.3, 5.4 May 12, 2022
@pissang pissang changed the base branch from master to next May 12, 2022 10:11
@pull-request-size pull-request-size bot added size/L and removed size/M labels May 12, 2022
@pissang pissang changed the base branch from next to master May 12, 2022 10:11
@pull-request-size pull-request-size bot added size/M and removed size/L labels May 12, 2022
Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Please also fix the lint problems found in the GitHub Actions.

@@ -172,6 +172,7 @@ export interface GaugeSeriesOption extends SeriesOption<GaugeStateOption, GaugeS

axisLabel?: LabelOption & {
formatter?: LabelFormatter | string
rotating?: boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using rotate as the of series[sunburst].label.rotate and instead of using a boolean type, I think it would be more useful to provide the type 'tangential' | 'radial' | number.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

Please also fix the lint problems found in the GitHub Actions.

I don‘t know why eslint config doesn't work in webstorm.
image

When running npm run lint:fix manually, nothing happen.
image

@MeetzhDing
Copy link
Contributor Author

MeetzhDing commented Jul 8, 2022

I would suggest using rotate as the of series[sunburst].label.rotate and instead of using a boolean type, I think it would be more useful to provide the type 'tangential' | 'radial' | number.

2022-07-08 122630

done. @Ovilia

@MeetzhDing
Copy link
Contributor Author

@Ovilia
Is there anything else wrong? I will be happy if this can be released with version 5.4.

Copy link
Contributor

@Ovilia Ovilia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have run visual tests for gauge related cases and all are as expected.

Comment on lines +313 to +314
verticalAlign: 'middle',
align: 'center'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you did an excellent job! This feature is really helpful!

Current implementation looks great. I only have a little doubt about text alignment. It doesn't look very obvious but if you look carefully, you should find that it may not be sufficient to use verticalAlign: 'middle', align: 'center'.

image

As you can see from this example, the text is aligned to center but in most situations, we may wish to align them to the inner side (which means align to right for text on the left side, and left on the right) or to the outter side vice versa.

gauge

But I think we can make this a new feature in another PR by providing new options as align and verticalAlign if you are interested or when some developers ask for such a feature. So I will approve this PR for now.

@echarts-bot
Copy link

echarts-bot bot commented Aug 9, 2022

To reviewers: If this PR is going to be described in the changelog in the future release, please make sure this PR has one of the following labels: PR: doc ready, PR: awaiting doc, PR: doc unchanged

This message is shown because the PR description doesn't contain the document related template.

@Ovilia Ovilia merged commit a29d37c into apache:master Aug 9, 2022
@echarts-bot
Copy link

echarts-bot bot commented Aug 9, 2022

Congratulations! Your PR has been merged. Thanks for your contribution! 👍

@Ovilia
Copy link
Contributor

Ovilia commented Aug 9, 2022

@MeetzhDing Please also help make a document PR to echarts-doc at the dev branch.

@Ovilia Ovilia removed this from the 5.4 milestone Sep 1, 2022
@Ovilia Ovilia added this to the 5.4.0 milestone Sep 1, 2022
Ovilia added a commit to apache/echarts-doc that referenced this pull request Sep 22, 2022
Ovilia added a commit to apache/echarts-doc that referenced this pull request Sep 22, 2022
doc(gauge): axisLabel support rotate apache/echarts#16985
Ovilia added a commit to apache/echarts-examples that referenced this pull request Sep 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants