We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,464 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

gdchart

Hello,

I wonder how to install GDChart in Windows XAMPP PHP ?

Thanks.

2
Contributors
8
Replies
3 Days
Discussion Span
6 Months Ago
Last Updated
9
Views
davy_yg
Master Poster
735 posts since May 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

If you have installed PEAR, use the package installer that comes with it.

pritaeas
Posting Prodigy
Moderator
9,533 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,494
Skill Endorsements: 98

I don't have PEAR installed yet. Nevermind, I use other alternatives like google chart.

I have this:

chart.php

<html>
  <head>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
        var data = google.visualization.arrayToDataTable([
          ['Year', 'Sales', 'Expenses'],
          ['2004',  1000,      400],
          ['2005',  1170,      460],
          ['2006',  660,       1120],
          ['2007',  1030,      540]
        ]);

        var options = {
          title: 'Company Performance',
          hAxis: {title: 'Year',  titleTextStyle: {color: 'red'}}
        };

        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>
  </head>
  <body>
    <div id="chart_div" style="width: 900px; height: 500px;"></div>
  </body>
</html>

It's a php file. Those codes are inside <?php ?>
I wonder why I get this error:

Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\Innovation\script_shop\adsmgt.php on line 59

davy_yg
Master Poster
735 posts since May 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

Look at or before line 59. Something is wrong there. I can't say if you don't show your code, you should know that by now.

pritaeas
Posting Prodigy
Moderator
9,533 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,494
Skill Endorsements: 98

line 59 is <html>

davy_yg
Master Poster
735 posts since May 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

This is the code above it:

while($row2 = mysql_fetch_array($result2))
{
echo "<br>".$row2['date']."&nbsp&nbsp&nbsp".$row2['time'];

}

//php_info();

<html>
  <head>

Parse error: syntax error, unexpected '<' in C:\xampp\htdocs\Innovation\script_shop\adsmgt.php on line 57

line 57 is <html>

davy_yg
Master Poster
735 posts since May 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

You did not close the php block with ?>

pritaeas
Posting Prodigy
Moderator
9,533 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,494
Skill Endorsements: 98

I actually did. Right after </html> ?>

davy_yg
Master Poster
735 posts since May 2011
Reputation Points: 10
Solved Threads: 1
Skill Endorsements: 2

You need to close it before <html>
You can't just mix HTML and PHP at will.

pritaeas
Posting Prodigy
Moderator
9,533 posts since Jul 2006
Reputation Points: 1,194
Solved Threads: 1,494
Skill Endorsements: 98

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0600 seconds using 2.46MB