Skip to content

Commit

Permalink
fix: add plugin to fix nonASCII font bug and combine pdf export bugfi…
Browse files Browse the repository at this point in the history
…x plugins
  • Loading branch information
HendrikThePendric committed Oct 16, 2024
1 parent ef76866 commit 69164e6
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/visualizations/config/generators/highcharts/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import HNDTD from 'highcharts/modules/no-data-to-display'
import HOE from 'highcharts/modules/offline-exporting'
import HPF from 'highcharts/modules/pattern-fill'
import HSG from 'highcharts/modules/solid-gauge'
import PEFP from './pdf_export_fix_plugin.js'
import PEBFP from './pdfExportBugFixPlugin/index.js'

// apply
HM(H)
Expand All @@ -16,7 +16,7 @@ HE(H)
HOE(H)
HPF(H)
HB(H)
PEFP(H)
PEBFP(H)

/* Whitelist some additional SVG attributes here. Without this,
* the PDF export for the SingleValue visualization breaks. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import nonASCIIFontBugfix from './nonASCIIFont.js'
import textShadowBugFix from './textShadow.js'

export default function (H) {
textShadowBugFix(H)
nonASCIIFontBugfix(H)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* This is a workaround for https://github.com/highcharts/highcharts/issues/22008
* We add some transparent text in a non-ASCII script to the chart to prevent
* the chart from being exported in a serif font */

export default function (H) {
H.addEvent(H.Chart, 'load', function () {
this.renderer.text('모', 20, 20).attr({ opacity: 0 }).add()
})
}

0 comments on commit 69164e6

Please sign in to comment.