Skip to content

Commit

Permalink
🐛 make label bold when value is shown
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiamersmann committed Dec 11, 2024
1 parent 550f8c2 commit d95d75e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -396,9 +396,8 @@ export class LineLegend extends React.Component<LineLegendProps> {
const maxAnnotationWidth = Math.min(maxTextWidth, 150)

return this.props.labelSeries.map((label) => {
// if a formatted value is given, make the main label bold by default
const fontWeight =
this.fontWeight ?? (label.formattedValue ? 700 : undefined)
// if a formatted value is given, make the main label bold
const fontWeight = label.formattedValue ? 700 : this.fontWeight

const mainLabel = { text: label.label, fontWeight }
const valueLabel = label.formattedValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,10 +549,7 @@ export class SlopeChart
}

@computed private get lineLegendPropsRight(): Partial<LineLegendProps> {
return {
xAnchor: "start",
fontWeight: 700,
}
return { xAnchor: "start" }
}

@computed private get lineLegendPropsLeft(): Partial<LineLegendProps> {
Expand Down

0 comments on commit d95d75e

Please sign in to comment.