Bonjour, je sèche un peu afin d'afficher des caractères chinois sur un graphique généré en PHP avec JPGraph. Je rencontre de jolis ??? au lieu de 中文.

J'ai pourtant bien les font chinoises (simsun et bkai00mp.ttf).

Ci-dessous, le code simple de mon test.

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 
<?php
 
require_once "/var/www/application/jpgraph2/jpgraph.php";
require_once "/var/www/application/jpgraph2/jpgraph_line.php";
 
$ydata = array(11,3,8,12,5,1,9,13,5,7);
 
$graph = new Graph(600,400,"auto");    
$graph->SetScale("textlin");
 
$lineplot=new LinePlot($ydata);
 
$graph->Add($lineplot);
 
$graph->img->SetMargin(40,20,20,40);
$graph->img->SetAntiAliasing("white");
$graph->title->SetFont(FF_CHINESE,FS_NORMAL, 14);
 
$graph->title->Set('中文');
$graph->xaxis->title->Set("X-title");
$graph->yaxis->title->Set("Y-title");
 
$graph->yaxis->title->SetFont(FF_FONT1,FS_BOLD);
$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);
 
$lineplot->SetColor("blue");
$lineplot->SetWeight(5);
$graph->yaxis->SetColor("red");
$graph->Stroke();
?>
Quelqu'un a t il déjà affiché du chinois avec JPGraph ?

Petite précision : L'affichage fonctionne bien si je passe directement le code du genre $graph->title->Set(' & # 20013; & # 25991;'); , mais pas si je souhaite passer directement les caractères chinois.