Hi - I've moved PHPLOT development to https://github.com/ajRepo/phplot . Can you open support requests there instead?
Hello, support phplot release-6.2.0 PHP8? Currently I am using release-6.2.0 with PHP7.4. Thank you very much for your efforts. Greetings Michael
If you get the "image contains errors" error on your browser, it usually means there is text in what's returned in addition to the binary data that defines the image. So perhaps your dbc.php has some HTML header information that it is returning or the like. To tell - look at the raw data being returned for the image and see. Also - I've moved development to git via github ( https://github.com/AJRepo/PHPlot/ ) from Sourceforge.
every other php file on my site uses: include dbc.php; WHY does this break phplot? i have to get the actual sql connection line out of this file and put it in my graph.php manually, or i get the "image contains errors" every time. what am i doing wrong here?
I checked the php.ini file and the extension gd was commented out. Changed it and restarted and my graphs are now working. I would never have thought of that. Thanks for the help!
Is gd installed?
I just updated xampp to the latest version which include PHP 8.0.2. When I tried to run my line graph i didn't get the graph. When I tried it in a command line I got the following error below. I reloaded xampp that has php 7 and reissued the same command line the output.png was perfect. I'm not sure why the failure. Has anyone encountered this problem and is there a work around or fix? Thanks C:\xampp\htdocs\TS2>php myscript.php > output.png PHP Fatal error: Uncaught TypeError: call_user_func():...
Problem solved - seems the latested RasPi Buster comes with Mysql pre-installed and when you do the LAMP install as seen on the the web - FUBAR!.
Pre: a curl script collects information on my heating/cooling system and inserts into a mysql DB. A Phplot web script on a Fedora box runs fine. Copied to a new Raspberry Pi - when run as a web app says "DrawGraph(): No data array". But if I run from the cmd line "php furnace.php > furn.png" and then http localhost/furn.png I get a perfect graph. Testing indicates that $data doesen't grow under apache. phpinfo() GD look the same as the Fedora box. include phplot.php mysql_connect select a, b, c,...
Pre: a curl script collect information on my heating/cooling system and inserts into a mysql DB. A Phplot web script on a Fedora box runs fine. Copied to a new Raspberry Pi - when run as a web app says "DrawGraph(): No data array". But if I run from the cmd line "php furnace.php > furn.png" and then http localhost/furn.png I get a perfect graph. Testing indicates that $data doesen't grow under apache. phpinfo() GD look the same as the Fedora box. include phplot.php mysql_connect select a, b, c, d...
That sounds like a kerning issue ( https://www.freetype.org/freetype2/docs/tutorial/step2.html ). So I would guess that - it is the differences between the Freetype setup that's causing that issue.
Hi, We're using phplot ver 6.2 on two significantly different versions of Mac OS (10.9 and 10.14). The Arial text font that we use renders differently on these two OS versions, though they both report using the same version of GD, (2.1.0 compatible). The effect is that both the character spacing and aspect ratio are different. The GD versionas reported by phpinfo(), and the truetype font files are the same, phpinfo() reports using different versions of Freetype, 2.3.11 versus 2.4.2. Does that explain...
That worked! I had to set up a font, but it does work now. Thanks.
Make sure you are using a TrueType font, e.g. with SetDefaultTTFont() and/or SetUseTTF(True). The built-in (non TrueType) GD fonts do not support what you are trying to do. Test with a hard-coded string, e.g. SetXTitle("Test Omega Ω") If you did (1), (2) works, but your code still does not work, you need to see exactly what MySQL is returning for that field. It should work with either the XML decimal numeric entity, or with the UTF-8 encoding of the character.
I am trying to put a greek Omega into the Y Axis Title. I'm following the PHPlot reference manual and its not working for me. Here's what I'm doing: I have a MySQL server. one of the fields is "YAxisTitle". so I use PHP to connect to the mySQL server, I find the record I want (out of 100ish). and pull the information from the fields, one of them is YAxisTitle. I use the Plot->SetYTitle ( mySQL_Result($datasource, 0, "YAxisTitle") but I can't get the Greek Letter Omega to come out. I used the examples...
DataLabels sometimes look very bold when using plotin option
Deprecation warning on PHP 7.2
Hello, My Code works perfekt. My "C-Code" print all 5 minuts in my SQL-Database datetime, / temperature, / humidity, / air pressure. I have only one problem. If i asked to many Hours in my SQL Query, take PHPlot all datetime data and plot them down. Can I handle it? That is my HTML Code for my Webinterface. <!DOCTYPE html> <html> <body background="Sturm.jpg"> <head> <title>Gesamtübersicht</title> <meta http-equiv="refresh" content="300; URL=http://localhost/index.html"/> </head> <p><h1 style="color:white";>Umweltdatenerfassung</h1></p>...
Hello, My Code works perfekt. My "C-Code" print all 5 minuts in my SQL-Database datetime, / temperature, / humidity, / air pressure. I have only one problem. If i asked to many Hours in my SQL Query, take PHPlot all datetime data and plot them down. Can I handle it? That is my HTML Code for my Webinterface. <!DOCTYPE html> <html> <body background="Sturm.jpg"> <head> <title>Gesamtübersicht</title> <meta http-equiv="refresh" content="300; URL=http://localhost/index.html"/> </head> <p><h1 style="color:white";>Umweltdatenerfassung</h1></p>...
Hello, My Code works perfekt. My "C-Code" print all 5 minuts in my SQL-Database datetime, / temperature, / humidity, / air pressure. I have only one problem. If i asked to many Hours in my SQL Query, take PHPlot all datetime data and plot them down. Can I handle it? That is my HTML Code for my Webinterface. <!DOCTYPE html> <html> <body background="Sturm.jpg"> <head> <title>Gesamtübersicht</title> <meta http-equiv="refresh" content="300; URL=http://localhost/index.html"/> </head> <p><h1 style="color:white";>Umweltdatenerfassung</h1></p>...
Hello, My Code works perfekt. My "C-Code" print all 5 minuts in my SQL-Database datetime, / temperature, / humidity, / air pressure. I have only one problem. If i asked to many Hours in my SQL Query, take PHPlot all datetime data and plot them down. Can I handle it? That is my HTML Code for my Webinterface. <!DOCTYPE html> <html> <body background="Sturm.jpg"> <head> <title>Gesamtübersicht</title> <meta http-equiv="refresh" content="300; URL=http://localhost/index.html"/> </head> <p><h1 style="color:white";>Umweltdatenerfassung</h1></p>...
I am trying to use the example (pdfplot.php). It does't work in my environment. My hosting is GoDaddy. I'm using a win10 laptop. I have tried it with PHP version 7.2 with, no luck. Here are the 2 errors I'm getting: Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; PDF_MemImage has a deprecated constructor in /home/tif0qktaow5f/public_html/PMT_Test/X_Testing/Graphs/pdfplot/mem_image.php on line 56 Fatal error: Uncaught Error: Call to undefined...
Can someone give me some pointers on how to generate a file containing two charts overlayed. I can generate a file showing a single plot by passing a filename in the 'new PHPlot' declaration but can't work out how to do the same with multiple plots. Ultimately I need to generate a horizontal bar chart with error bars and the only way I can think of doing this is combining a horizontal bar chart with a horizontal error chart. Any other options I can use would also be very useful. Many thanks.
Should be straightforward 1) Set PHPlot to save the image (e.g. /tmp/my_phplot_output.png; ) (Look for SetOutputFile) 2) With FPDF $image1 = '/tmp/my_phplot_output.png'; // Insert a logo in the top-left corner $pdf->Image($image1,10,10); or 2) create a cell and put the image in it. //have a cell 40x40 with an image in it, no border, left aligned with text $this->Cell( 40, 40, $pdf->Image($image1, $pdf->GetX(), $pdf->GetY()), 0, 0, 'L', false );
Should be straightforward 1) Set PHPlot to save the image (e.g. /tmp/my_phplot_output.png; ) (Look for variable $output_file) 2) With FPDF $image1 = '/tmp/my_phplot_output.png'; // Insert a logo in the top-left corner $pdf->Image($image1,10,10); or 2) create a cell and put the image in it. //have a cell 40x40 with an image in it, no border, left aligned with text $this->Cell( 40, 40, $pdf->Image($image1, $pdf->GetX(), $pdf->GetY()), 0, 0, 'L', false );
Dear All, Issue resolved. For completeness sake the following resolved my issue. $plot->SetIsInline(true); $plot->SetOutputFile('file_name'); then you need to place it as an image. Regards and thank you
Dear Team, Can I ask whether it is possible to use the output of PHplot as an image to insert it in a pdf using fpdf? All examples that I have seen and tested are attributed to creation of plots as stand alone. What I require is to include phplots inside other content. The graphs have to be dynamically generated and then the resulting output be included in a report. Thanks for your assistance.
lbayuk, THANKS for the reply. I was able to get the log plot working based on your suggestion. The tick marks are still a problem. If I have some time--very unlikely anytime in the near future--maybe I'll dig into the phplot code and see if I fix this issue myself and then hand the fixed code over to y'all. Thanks again, James N
The message "expects integer, float given" is a little misleading. Normally the float given to imageline() is a whole number which gets silently converted to integer. In your case, mostly likely, the Y value is 0 or negative. For a log plot that gets you INF or NaN respectively, which cannot be converted to integer. Check your data. You probably have some Y <= 0.0. Can't do that with a log plot. As for tick marks, log plots have never been implemented that well. Very simple cases work OK but that's...
The image didn't seem to post, so here it is:
I'm using phplot-6.2.0 on a MacBook Pro running OS 10.13.5 and PHP Version 7.2.0 and I'm getting the warning in the subjectline, and I'm not sure why. The code I'm running that is causing the problem is: $plot = new PHPlot(1375, 800); $plot->SetBackgroundColor('white'); $plot->SetDataValues($array_lin); $plot->SetFailureImage(False); $plot->SetFont('legend', 5); $plot->SetFont('title', 5); $plot->SetFont('x_label', 5); $plot->SetFont('y_label', 5); $plot->SetPlotType('thinbarline'); $plot->SetPrintImage(False);...
Thanks for the explanation and solution managed to spend a few hours down this hole myself.
imagesetclip() and imagegetclip() are available in PHP 7.2.
Hi, I hope I'm not treading on toes here... I found what I believe to be a bug (or at least a misfeature) in PHPlot, which I developed a fix for. I would like to (a) discuss whether this is indeed the appropriate fix, and if so (b) contribute it back to the community. The web site phplot.org refers to a repository on github, but there seems to be no activity and the code there seems to be identical to that here. The only active forum I've found is this one, so here goes... There are comments in the...
I am following example 5.34 and the output has an extra series in the legend of the second plot. It appears to be carried over from the first plot. I am pulling the temperature and humidity data from mysql into two arrays Then I use the overlay plot to plot both. The legend on the second plot to the right contains the keys Temperaturea and humidity. <?php require_once 'connect.php'; require 'phplot.php'; $tempData = array(); $humidData = array(); while($temperature=mysql_fetch_assoc($temperatures))...
Anyone? need more info? What would be the next step please? Thank you
Further to my comment, I find the pie chart is rather "moody". It is not only the title, but I change the size a bit and it only shows that little picture from the browser not the pie chart. I add one thing in one pie chart, it works. I do the same thing in another pie chart and it disappears i. e. $product->SetImageBorderType('plain'); or changing $product->SetBackgroundColor('#ffffff'); to $product->SetBackgroundColor('#eeeeee'); or changing $product = new PHPlot(320,200); to $product = new PHPlot(330,200);...
Further to my comment, I find the pie chart is rather "moody". It is not only the title, but I add the size a bit and it only shows that little picture from the browser not the pie chart. I add one thing in one pie chart, it works. I do the same thing in another pie chart and it disappears i. e. $product->SetImageBorderType('plain'); or changing $product->SetBackgroundColor('#ffffff'); to $product->SetBackgroundColor('#eeeeee'); or changing $product = new PHPlot(320,200); to $product = new PHPlot(330,200);...
Further to my comment, I find the pie chart is rather "moody". It is not only the title, but I add the size a bit and it only shows that little picture from the browser not the pie chart. I add one thing in one pie chart, it works. I do the same thing in another pie chart and it disappears (i. e. $product->SetImageBorderType('plain');) ... No log errors, no html error. Is there any other log I could check? Are there specific orders how to add the values?
no error - let's say that the title was "Title" and I changed it to "Titles" and whoop plot dissapears.
If the entire image disappears there may be an text error message returned which will cause the image to seem to disappear. Look in the logs for an error message - perhaps a comma missing, and.or look at the HTML source returned in that image to see if there's an error message.
Hi there, I have a really a strange issue of my pie chart not showing when I change the title of the chart. The titel is either in a variable $titel or in single quotes or double quotes. The values are correct because I can see the pie. Any idea how I can trouble shoot, avoid this please? Thank you, Slarti
Thank you very much! These two suggestions worked for me.
the function json_encode just returns a string representation of the data. Try having $data as an array. Something like $data = array( array('Mon', 5), array('Tue', 15), array('Wed', 9), array('Thu', 9), array('Sat', 4), array('Sun', 1) ); See the docs ex-bars1.html for more info and multiple data per day e.g. $data = array( array('Mon',5,1), array('Tue',15,4), ... );
the function json_encode just returns a string representation of the data. Try having $data as an array. Something like $data = array( array('Mon', 5), array('Tue', 15), array('Wed', 9), array('Thu', 9), array('Sat', 4), array('Sun', 1) ); See the docs ex-bars1.html for more info.
In attempoting to correct my output issue I have been trying to use json_encode() on the dataset resulting from my query. I can echo the data and it appears "correct" visually. But when I attempt to build a chart I get an error "Fatal error: SetDataValues(): Invalid data array (row 0) " I looked this up in the documentation and wasn;t sure of the underlying cause, but the comments referenced verison5.5 as having a fix. Here is what I have so far: $inc= $stmt->fetchAll(PDO::FETCH_ASSOC); $data = json_encode($inc);...
I am just starting with PHPlot. I have an application that would benefit greatly from adding charts to the reports currently being generated. First, I was looking for MySQL calls based on PDO. I have been able to pull data from my database using the fetchAll(PDO::FETCH_BOTH) command. But I am trying to build a stacked bar chart with days of the week as the x labels (text) and the sum of incidents (data) as the Y values. I was also trying to stack the values based on an incident code (text). The examples...
For the X-labels - yes you can print only a few labels. One way is to set the X-label to blank (e.g. '') for those you don't want displayed. See the example prune_labels.php For the Y-labels perhaps Custom Data Value Labeling is what you want. See the example: ex-dlexformat.html in the docs.
Hello, I'm using a linepoints graph and would like to know if there's a way to print/show the Y data label only when f(x) is different from f(x-1). In the moment I'm plotting all the Y values, but since I have a somewhat big area of world, these labels are cramped and terrible to read. Since I have a lot of points in which the Y value remains the same and I also need to print all of my X labels (disregarding if the Y value has changed or not), I would like to know if there's a way to add a condition...
Hello, I'm using a linepoints graph and would like to know if there's a way to print/show the Y data label only when f(x) is different from f(x-1). In the moment I'm plotting all the Y values, but since I have a somewhat big area of world, these labels are cramped and terrible to read. Since I have a lot of points in which the Y value remains the same and I also need to print all of my X labels (disregarding if the Y value has changed or not), I would like to know if there's a way to add a condition...
Hello, I'm using a linepoints graph and would like to know if there's a way to print/show the Y data label only when f(x) is different from f(x-1). In the moment I'm plotting all the Y values, but since I have a somewhat big area of world, these labels are cramped and terrible to read. Since I have a lot of points in which the Y value remains the same and I also need to print all of my X labels (disregarding if the Y value has changed or not), I would like to know if there's a way to add a condition...
Hello, I'm using a linepoints graph and would like to know if there's a way to print/show the Y data label only when f(x) is different from f(x-1). In the moment I'm plotting all the Y values, but since I have a somewhat big area of world, these labels are cramped and terrible to read. Since I have a lot of points in which the Y value remains the same and I also need to print all of my X labels (disregarding if the Y value has changed or not), I would like to know if there's a way to add a condition...
Hello! I need help with the legend with pie chart. Everytime that the legend string...
Hello! I need help with the legend with pie chart. Everytime that the legend string...
Hello! I need help with the legend with pie chart. Everytime that the legend string...
Hi, I just posted a suggestion about modifying the manual page for SetUseTTF(). I...
Hi, I suggest the documentation for this command be updated to move the 3rd paragraph...
Firstly i must apologise if there is a similar question that i could not find. What...
UPDATE: I solved this problem. At first, I thought it was because I was using the...
I developed this on a Kubuntu desktop and it worked fine (http://data.moherp.org/rivers/niangua-gauge.png)....
I developed this on a Kubuntu desktop and it worked fine (http://data.moherp.org/rivers/niangua-gauge.png)....
I have a stacked area plot where I would like to add the following: dashed vertical...
I have a stacked area plot where I would like to add the following: dashed vertical...
I am very confused with what i do now . the data doesn't show up. I want to show...
Hi All, We are upgrading our Mac Mini webserver to El Capitan (OSX 10.11) by doing...
Hey Guys, I have tried to draw some plots with phpplot. If I draw with linear yscale...
I briefly looked at phplot.php and saw the variables $yo, $yh, $yl, $yc which looks...
I briefly looked at phplot.php and saw the variables $yo, $yh, $yl, $yc which looks...
I'm interested in using phplot to graph a different candlestick chart called heikin...
I found solution. For the second plot I set x label type to default: $plot->SetX...
I would like to include an average or median line on my graphs. Can this be done
Hello all. I found a strange thing, maybe it`s bug. I created two plots on the one...
Hello all. I found a strange thing, maybe it`s bug. I created two plots on the one...
how do i add category labels to scatter plot points please? The examples that ive...
how do i add category labels to scatter plot point please? The examples that ive...
how do i add category labels to scatter plot point please? The examples that ive...
Okay, thank you very much, I appreciate your help! I will try again with your ti...
Let's back up a bit and see what you are trying to do with multi-plot. There are...
Hey guys :) maybe I found a bug in PHPlot or I'm too silly for using PHPlot the right...
Hey guys :) maybe I found a bug in PHPlot or I'm too silly for using PHPlot the right...
Hey guys :) maybe I found a bug in PHPlot or I'm too silly for using PHPlot the right...
Hey guys :) maybe I found a bug in PHPlot or I'm too silly for using PHPlot the right...
Hey guys :) maybe I found a bug in PHPlot or I'm too silly for using PHPlot the right...
Thank you for the Reply I want to download the image created , please tell me how...
I am hosting the application on a an Ubuntu server. I am trying to output an error...
I am not sure what you mean by "remove the decimal value on the axis". Do you mean...
Admin note: I changed your second post to put markers around the code so it would...
http://208.109.186.112/pradeepma/dyanamic_graph/d2/rating.png this is the Image I...
Code at the php file <?php error_reporting(E_ALL); ini_set('display_errors', TRUE);...
Code at the php file require_once 'phplot.php'; $image_map = ""; $title=$_POST['Shoe_name'];...
this is the Image I genearted from the taking value from the html form. I am stuck,...
It would look like this: The center of the leftmost/rightmost character is fixed...
The first thing that comes to mind is - is it really a JPEG image file? Because it...
I have my diagram output to my download folder on the server with $plot->SetOutputFile($output_file);...
As you found, PHPlot always draws labels below the X axis using "horizontal: center,...
Is there a possibility to define a minimum label margin for the automatic Y-Tick...
Thank you very much :-)
Hello have now resorted to the Verdana font, unfortunately, can not the scripture...
thank you very much - works great - how can I change the whole to the true font?...