Skip to content

The Chinese font settings for the titles and legends of chart categories are not effective #1420

@subangbang19950406

Description

@subangbang19950406
	const dataChartPieStatAA = [
		{
			name: "Project Status",
			labels: ['enlish work enlish work', "智能驾驶销售系统", "我啊你你好", "我啊你你好5", "我啊你你好4", "我啊你你好3"],
			values: [25, 5, 5, 5, 5, 5],
		}
	]
	const COLOR_RED = "FF0000";
	const COLOR_YLW = "F2AF00";
	const COLOR_GRN = "7AB800";
	const COLOR_COMP = "4472C4";
	const COLOR_CANC = "672C7E";
	const COLOR_UNK = "A9A9A9";
	const COLORS_RYGUAA = [COLOR_RED, COLOR_YLW, COLOR_GRN, COLOR_COMP, COLOR_CANC, COLOR_UNK];
	
	// TOP-LEFT
	slide.addChart(pptx.charts.PIE, dataChartPieStatAA, {
		x: 0.5,
		y: 0.6,
		w: 4.0,
		h: 3.2,
		chartArea: { fill: { color: "F1F1F1" } },
		chartColors: COLORS_RYGUAA,
		dataBorder: { pt: 1, color: "F1F1F1" }, 
		//
		legendPos: "l", 
		legendFontFace: "BMWGroupTN Condensed Regular",
		showLegend: true, /
	
		// showPercent: true, 是否显示百分比
		showValue: true, 
		dataLabelColor: "FFFFFF",
		dataLabelFontSize: 14, 
		dataLabelPosition: "bestFit",
		dataLabelFontFace: 'BMWGroupTN Condensed Regular',

		showTitle: true,
		title: "销售部门整体业绩 销售部门整体业绩",
		titleColor: "0088CC",
		titleFontSize: 14,
		titleFontFace: 'Arial',
		titleAlign: "left",
		titlePos: { x: 0, y: 0 },
	});`

When using bar, line, and pie charts, taking the pie code as an example,

(1)When setting the titleFontFace for the title, if the title is in Chinese, the font displayed in the attribute bar is not the one set in the code, but the font "Body", which is normal in English, as shown in the figure:

<img width="932" height="547" alt="Image" src="https://github.com/user-attachments/assets/627477d2-a27c-4ce4-ab0e-354cf9904d8f" />


(2)When setting LegendFontFace, if Chinese is set, the font displayed in the property bar is the one set in the code, but the actual display is not the font set in the code, but a font similar to Japanese, as shown in the figure:

<img width="540" height="505" alt="Image" src="https://github.com/user-attachments/assets/2d38eb78-4c0c-4e5c-aa81-8bea69eb2aac" />

tip: I have checked the official website demo and it also has this issue.

Expectation: The Chinese font set will also take effect normally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions