Menu

pChart not rendering after update to PHP

Help
2018-10-04
2019-06-06
  • Roger Hicks

    Roger Hicks - 2018-10-04

    I have developed a website (www.rookeries.uk) incorporating pchart. This have been live now for 18-months. A recent upgrade of PHP (from 7.0 to 7.2) has resulted in the pcharts not being rendered and a blank page being displayed. If i remove the pchart from a page, the page is correctly displayed (minus the chart).

    I used Netbeans to develop the website and the charts are still displayed in this environment.

    What do I need to change to get pchart to work with PHP 7.2.

    Thanks

    Roger Hicks

     
  • Ryan Ewen

    Ryan Ewen - 2019-06-06

    I ran into issues going from PHP 5.6 to 7.1 and was sad to see there's no update to fix this.

    However I used XDebug to step through the code and see what the hangup was. In my case I was able to fix it by changing just 2 lines:

    pData.class before:

       function pData()
        {
         $this->Data                           = "";
         $this->DataDescription                = "";
    

    pData.class after:

       function pData()
        {
         $this->Data                           = array();
         $this->DataDescription                = array();
    

    Hope this helps in your case as well

     

Log in to post a comment.

MongoDB Logo MongoDB