Skip to content

Commit

Permalink
fix: render single value main text in normal font weight when exporti…
Browse files Browse the repository at this point in the history
…ng to pdf
  • Loading branch information
HendrikThePendric committed Nov 14, 2024
1 parent a844209 commit f7390d3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { DynamicStyles } from './styles.js'
export default function loadSingleValueSVG() {
const { formattedValue, icon, subText, fontColor } =
this.userOptions.customSVGOptions
const dynamicStyles = new DynamicStyles()
const dynamicStyles = new DynamicStyles(this.userOptions?.isPdfExport)
const valueElement = this.renderer
.text(formattedValue)
.attr('data-test', 'visualization-primary-value')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ const spacings = [
export const MIN_SIDE_WHITESPACE = 4

export class DynamicStyles {
constructor() {
constructor(isPdfExport) {
this.currentIndex = 0
this.isPdfExport = isPdfExport
}
getStyle() {
return {
value: {
...valueStyles[this.currentIndex],
'font-weight': '300',
'font-weight': this.isPdfExport ? 'normal' : '300',
},
subText: subTextStyles[this.currentIndex],
spacing: spacings[this.currentIndex],
Expand Down

0 comments on commit f7390d3

Please sign in to comment.