0

searched everywhere and read every post on this and can't find a match so here goes:

Have a Codeigniter/PHP graphing/charting app written using pchart library. Works fine locally on Windows 7, but labels and all text is missing when I delpoy to OpenShift. Images display correctly - just no axis labels or free text within the image.

GD support enabled on OpenShift PHP.

Fonts all in correct places.

Filepath variable (I'm using an "APPPATH" one) tested and pointing to correct locations.

All fonts where they should be.

Help!

Edit: here's some code: Sure here you go. Not sure if you guys are php or pchart experts but here you go:

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);
}
  • Some example code would help people answer your question. –  May 30 '14 at 12:08
  • Just added some code above - thanks Corey! – user3550402 May 30 '14 at 13:48
  • Have you tried turning on any kind of errors or debugging and looking at the php log files to see if something is going wonky? –  May 30 '14 at 20:32
  • Yes of course - sorry I didn't mention that. running "rch tail" throughout this and nothing... :( – user3550402 May 31 '14 at 01:05
  • Solved it! Foolish error - my developer had specified the fonts directory in code with lower case "fonts", although the directory was not always created that way. And then with git it is impossible to "mv" a directory from "Fonts" to "fonts" since git is case-insensitive. Have to move it to placeholder name, then move it to "fonts". – user3550402 Jun 02 '14 at 21:24

1 Answers1

0

Solved it! Foolish error - my developer had specified the fonts directory in code with lower case "fonts", although the directory was not always created that way. And then with git it is impossible to "mv" a directory from "Fonts" to "fonts" since git is case-insensitive. Have to move it to placeholder name, then move it to "fonts"