您的位置:軟件測試 > 開源軟件測試 > 開源Bug管理工具 > BugFree
mantis 安裝 呵呵 和bugfree 都是開源的哦
作者:網(wǎng)絡(luò)轉(zhuǎn)載 發(fā)布時間:[ 2013/12/12 9:52:48 ] 推薦標(biāo)簽:

8) 不過如果你是用簡體中文或者繁體中文,那么你會看到圖形中的漢字都是亂碼,這是因為Mantis對于JPGraph的編碼設(shè)置不正確造成的,JPGraph會自動將漢字轉(zhuǎn)換為UTF-8編碼,但是需要在調(diào)用JPGraph的時候?qū)?biāo)題等SetFont,Mantis沒有做這個操作,因此漢字顯示出來都是亂碼,解決方法是在Mantiscoregraph_api.php中增加對圖形標(biāo)題等設(shè)置字體的代碼; 對于柱圖和線圖,要設(shè)置圖形標(biāo)題和x、y軸標(biāo)題、節(jié)點標(biāo)題:

//Set the title and axis font if the default_language is set to chinese if (config_get('default_language') == 'chinese_simplified')

{

$graph->title->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

$graph->xaxis->title->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

$graph->yaxis->title->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

$graph->xaxis->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

$graph->yaxis->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

}

 else if (config_get('default_language') == 'chinese_traditional')

{

$graph->title->SetFont(FF_CHINESE,F(xiàn)S_NORMAL);

$graph->yaxis->title->SetFont(FF_CHINESE,F(xiàn)S_NORMAL) ;

$graph->xaxis->title->SetFont(FF_CHINESE,F(xiàn)S_NORMAL) ;

$graph->xaxis->SetFont(FF_CHINESE,F(xiàn)S_NORMAL);

$graph->yaxis->SetFont(FF_CHINESE,F(xiàn)S_NORMAL); };

對于餅圖,要設(shè)置圖形標(biāo)題和圖例名稱:

//Set the title and legend font if the default_language is set to chinese if

(config_get('default_language') == 'chinese_simplified')

{

$graph->title->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

$graph->legend->SetFont(FF_SIMSUN,F(xiàn)S_NORMAL);

}

else if (config_get('default_language') == 'chinese_traditional')

{

$graph->title->SetFont(FF_CHINESE,F(xiàn)S_NORMAL);

$graph->legend->SetFont(FF_CHINESE,F(xiàn)S_NORMAL);

};

大家可以找到位置自己修改,簡單的說是在graph_api.php中每個“$graph->title->Set(…”后面根據(jù)當(dāng)前的圖表是柱圖、線圖還是餅圖分別加上上面兩段;

9) 現(xiàn)在你的圖形報表應(yīng)該可以顯示中文了。 好了,Mantis的配置工作到此結(jié)束了。

上一頁1234下一頁
軟件測試工具 | 聯(lián)系我們 | 投訴建議 | 誠聘英才 | 申請使用列表 | 網(wǎng)站地圖
滬ICP備07036474 2003-2017 版權(quán)所有 上海澤眾軟件科技有限公司 Shanghai ZeZhong Software Co.,Ltd