How to solve the following error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sean kwok
    New Member
    • Oct 2011
    • 16

    #1

    How to solve the following error

    Hi,
    I'm new to php, currently i'm trying to create a pie chart but i face this error.

    This is the error msg : Fatal error: Class 'PieChart' not found in C:\wamp\www\Cou nter.php on line 10

    This is the code -
    Code:
    <?php
    $chart = new PieChart(500, 250);
    
    	$dataSet = new XYDataSet();
    	$dataSet->addPoint(new Point("A(80)", 80));
    	$dataSet->addPoint(new Point("B(75)", 75));
    	$dataSet->addPoint(new Point("C(50)", 50));
    	$chart->setDataSet($dataSet);
    
    	$chart->setTitle("Hi");
    	$chart->render("D.png");
        ?>
  • johny10151981
    Top Contributor
    • Jan 2010
    • 1059

    #2
    include the path of the class file

    Comment

    • sean kwok
      New Member
      • Oct 2011
      • 16

      #3
      Originally posted by johny10151981
      include the path of the class file
      so i just have to add include 'class.PieChart .php'; ?

      Comment

      • johny10151981
        Top Contributor
        • Jan 2010
        • 1059

        #4
        If you dont include the specific file you surely cannot access the class in the file..

        Comment

        • sean kwok
          New Member
          • Oct 2011
          • 16

          #5
          Originally posted by johny10151981
          If you dont include the specific file you surely cannot access the class in the file..
          can use show me how? sry i'm totally new to it.

          Comment

          • zorgi
            Recognized Expert Contributor
            • Mar 2008
            • 431

            #6

            Comment

            Working...