diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts index 8622b11273..daa1ee58a0 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/flow-map.ts @@ -268,7 +268,8 @@ export class FlowMap extends L7ChartView { textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直] spacing: 2, // 字符间距 padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - textAllowOverlap: true + textAllowOverlap: true, + fontFamily: chart.fontFamily ? chart.fontFamily : undefined }) configList.push(startTextLayer) } @@ -295,7 +296,8 @@ export class FlowMap extends L7ChartView { textOffset: [0, 0], // 文本相对锚点的偏移量 [水平, 垂直] spacing: 2, // 字符间距 padding: [1, 1], // 文本包围盒 padding [水平,垂直],影响碰撞检测结果,避免相邻文本靠的太近 - textAllowOverlap: true + textAllowOverlap: true, + fontFamily: chart.fontFamily ? chart.fontFamily : undefined }) configList.push(endTextLayer) } diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts index a45373f361..472d8283d1 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/map.ts @@ -384,7 +384,8 @@ export class Map extends L7PlotChartView { domStyles: { 'l7plot-legend__category-value': { fontSize: legend.fontSize + 'px', - color: legend.color + color: legend.color, + 'font-family': chart.fontFamily ? chart.fontFamily : undefined }, 'l7plot-legend__category-marker': { ...LEGEND_SHAPE_STYLE_MAP[legend.icon], diff --git a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts index 221f27fd33..15af044931 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/charts/map/symbolic-map.ts @@ -394,7 +394,7 @@ export class SymbolicMap extends L7ChartView { } ` document.head.appendChild(style) - const htmlPrefix = `
` + const htmlPrefix = `
` const htmlSuffix = '
' const containerElement = document.getElementById(container) if (containerElement) { @@ -522,7 +522,8 @@ export class SymbolicMap extends L7ChartView { .style({ textAllowOverlap: label.fullDisplay, textAnchor: 'center', - textOffset: [0, 0] + textOffset: [0, 0], + fontFamily: chart.fontFamily ? chart.fontFamily : undefined }) ) } diff --git a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts index eee00b346c..dd4a1979cf 100644 --- a/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts +++ b/core/core-frontend/src/views/chart/components/js/panel/common/common_antv.ts @@ -196,7 +196,8 @@ export function getLabel(chart: Chart) { layout, style: { fill: l.color, - fontSize: l.fontSize + fontSize: l.fontSize, + fontFamily: chart.fontFamily }, formatter: function (param: Datum) { return valueFormatter(param.value, l.labelFormatter) @@ -903,6 +904,9 @@ export function configL7Label(chart: Chart): false | LabelOptions { style.textAllowOverlap = false style.padding = [2, 2] } + if (chart.fontFamily) { + style.fontFamily = chart.fontFamily + } return { visible: label.show, style @@ -981,7 +985,8 @@ export function configL7Tooltip(chart: Chart): TooltipOptions { 'l7plot-tooltip': { 'background-color': tooltip.backgroundColor, 'font-size': `${tooltip.fontSize}px`, - 'line-height': 1.6 + 'line-height': 1.6, + 'font-family': chart.fontFamily ? chart.fontFamily : undefined }, 'l7plot-tooltip__name': { color: tooltip.color