-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable trim and wrap feature to axis label #1905
base: master
Are you sure you want to change the base?
Conversation
@@ -12,6 +12,7 @@ import { | |||
import { XAxisTicksComponent } from './x-axis-ticks.component'; | |||
import { Orientation } from '../types/orientation.enum'; | |||
import { ViewDimensions } from '../types/view-dimension.interface'; | |||
import { select } from 'd3-selection'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Group d3 import with other external imports (eg @angular/core)
projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts
Outdated
Show resolved
Hide resolved
projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts
Outdated
Show resolved
Hide resolved
projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts
Outdated
Show resolved
Hide resolved
projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts
Outdated
Show resolved
Hide resolved
// labelLength = number of characters | ||
let labelLength = this.labelText.length; | ||
this.labelTextTemp = this.labelText; | ||
this.maxLabelLength = Number(this.maxLabelLength); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this.maxLabelLength already a number?
projects/swimlane/ngx-charts/src/lib/common/axes/y-axis.component.ts
Outdated
Show resolved
Hide resolved
projects/swimlane/ngx-charts/src/lib/common/axes/x-axis.component.ts
Outdated
Show resolved
Hide resolved
projects/swimlane/ngx-charts/src/lib/common/axes/y-axis.component.ts
Outdated
Show resolved
Hide resolved
@Input() maxLabelLength: number; | ||
@Input() trimLabel: boolean; | ||
@Input() wrapLabel: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are these inputs for?
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
…ent.ts Co-authored-by: Yuqing Liu <[email protected]>
What kind of change does this PR introduce? (check one with "x")
What is the current behavior?
The appearance of the long axis label is visually unappealing.
Issue #1904
What is the new behavior?
Applied the following feature to Vertical Bar chart and horizontal Bar chart
Does this PR introduce a breaking change? (check one with "x")