どこでも検索し、これに関するすべての投稿を読んで、一致するものを見つけることができないので、ここに行きます:
pchart ライブラリを使用して Codeigniter/PHP のグラフ作成/チャート作成アプリを作成します。Windows 7 ではローカルで正常に動作しますが、OpenShift にデルポイすると、ラベルとすべてのテキストが失われます。画像は正しく表示されます。画像内に軸ラベルやフリー テキストがないだけです。
OpenShift PHP で有効化された GD サポート。
フォントはすべて正しい場所にあります。
ファイルパス変数(私は「APPPATH」変数を使用しています)がテストされ、正しい場所を指しています。
すべてのフォントをあるべき場所に。
ヘルプ!
編集:ここにいくつかのコードがあります: はい、どうぞ。あなたたちがphpまたはpchartの専門家であるかどうかはわかりませんが、ここに行きます:
public function initChart($chartTitle,$chartName,$chartWidth=700, $chartHeight=250){
require_once(APPPATH.'/libraries/pchart/class/pDraw.class.php');
require_once(APPPATH.'/libraries/pchart/class/pImage.class.php');
/* Create the pChart object */
$this->pImage = new pImage($chartWidth,$chartHeight,$this->pData);
/* Draw the background */
$Settings = array("R"=>255, "G"=>255, "B"=>255, "Dash"=>0, "DashR"=>0, "DashG"=>0, "DashB"=>0);
$this->pImage->drawFilledRectangle(0,0,$chartWidth,$chartHeight,$Settings);
/* Add a border to the picture */
$this->pImage->drawRectangle(0,0,$chartWidth-1,$chartHeight-1,array("R"=>0,"G"=>0,"B"=>0));
/* Write the chart title */
$this->pImage->setFontProperties(array("FontName"=>APPPATH."/libraries/pchart/fonts/verdana.ttf","FontSize"=>9));
$this->pImage->drawText(230,20,$chartTitle,array("FontSize"=>16)); //,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE
/* Draw the scale and the 1st chart */
$this->pImage->setGraphArea(60,30,$chartWidth-50,$chartHeight-60);
$this->pImage->drawFilledRectangle(60,30,$chartWidth-50,$chartHeight-60,array("R"=>255,"G"=>255,"B"=>255,"Surrounding"=>-200,"Alpha"=>10));
$Settings = array("Pos"=>SCALE_POS_LEFTRIGHT
, "Mode"=>SCALE_MODE_ADDALL_START0
, "LabelingMethod"=>LABELING_DIFFERENT
, "LabelSkip"=>2, "GridR"=>255, "GridG"=>255, "GridB"=>255, "GridAlpha"=>50, "TickR"=>0, "TickG"=>0, "TickB"=>0, "TickAlpha"=>50, "LabelRotation"=>45, "CycleBackground"=>1, "DrawXLines"=>1, "DrawSubTicks"=>1, "SubTickR"=>255, "SubTickG"=>0, "SubTickB"=>0, "SubTickAlpha"=>50, "DrawYLines"=>ALL);
$this->pImage->drawScale(array('LabelRotation'=>45,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"Mode"=>SCALE_MODE_ADDALL_START0,"CycleBackground"=>TRUE)); //
$this->pImage->setFontProperties(array("FontName"=>APPPATH."/libraries/pchart/fonts/verdana.ttf","FontSize"=>8));
$this->pImage->drawLineChart(array("DisplayValues"=>FALSE,"DisplayColor"=>DISPLAY_MANUAL,"R"=>0,"G"=>0,"B"=>255,"DisplayR"=>0, "DisplayG"=>0, "DisplayB"=>255));
$this->pImage->setShadow(FALSE);
$this->pImage->render(APPPATH."views/images/charts/".$chartName);
}