Skip to content

Commit

Permalink
✨ (slope) prevent x-label and entity labels from overlapping
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 2, 2024
1 parent 80185ab commit 9f42d9c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ export class LineLegend extends React.Component<LineLegendProps> {
const labelFragments = excludeUndefined([
{ text: label.label, fontWeight },
label.formattedValue
? { text: label.formattedValue }
? {
text: label.formattedValue,
preferLineBreakOverWrapping: true,
}
: undefined,
])
const textWrap = new TextWrapGroup({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,7 +1001,7 @@ export class SlopeChart
labelSeries={this.lineLegendSeriesRight}
yAxis={this.yAxis}
x={this.xRange[1] + LINE_LEGEND_PADDING}
yRange={[this.bounds.top, this.bounds.bottom]}
yRange={[this.bounds.top, this.bounds.bottom - BOTTOM_PADDING]}
maxWidth={this.maxLineLegendWidth}
xAnchor="start"
verticalAlign={VerticalAlign.top}
Expand Down Expand Up @@ -1037,7 +1037,7 @@ export class SlopeChart
labelSeries={this.lineLegendSeriesLeft}
yAxis={this.yAxis}
x={this.xRange[0] - LINE_LEGEND_PADDING}
yRange={[this.bounds.top, this.bounds.bottom]}
yRange={[this.bounds.top, this.bounds.bottom - BOTTOM_PADDING]}
maxWidth={this.maxLineLegendWidth}
xAnchor="end"
verticalAlign={VerticalAlign.top}
Expand Down

0 comments on commit 9f42d9c

Please sign in to comment.