Questions tagged [pchart]

pChart is an object oriented PHP charting library.

pChart is a community led PHP library that uses PHP GD & Freetype extensions to generate chart images on the server side to be directly fed to the client's browser or applications such as email or PDFs.

138 questions
0
votes
1 answer

Print only some labels along the x-axis in pChart 2.0

I have a set of data that I show in my chart generated in pChart, like this: The problem is that I want to print only some labels in the x-axis and show the last label in the last point, keeping the same appearance of the curve. How can I do that?…
Bizboss
  • 7,792
  • 27
  • 109
  • 174
0
votes
1 answer

Php chart pchart library linux windows difference

Hi i am trying to use pchart library but i am getting some weird results in CentOS vps different from my windows server machine. the code is a sample and basic one like /* Naked: Naked and easy! */ // Standard inclusions …
Evan
  • 1,683
  • 7
  • 35
  • 65
0
votes
1 answer

two charts in one image using pchart

I'm struggling to generate two charts in same image. The problem that I have at this moment is that when I'm using my approach, i get some bad results. As you can see from the output picture, I get two vertical axes on the first chart. I need two…
dole doug
  • 34,070
  • 20
  • 68
  • 87
0
votes
0 answers

chart js datapoints are not the same numer for all products

I have a chartjs that shows one of the line wrongly: enter image description here As you can see the "DIESEL" product has not the same numbers of data points that others product: enter image description here The problem is the datapoint for "DIESEL"…
Edwin
  • 1
0
votes
1 answer

Unable to create a chart with Y axis of 0-359 in PHP

One thing I've been struggling with in pChart is keeping the Y axis within the boundaries of the compass directions. In my case I am attempting to plot wind direction for a weather station, however the resulting charts always come out with a scale…
0
votes
0 answers

pChart - displaying bar chart above and below the 0 line

This is an old library I know but does anyone know the setting to get the bars to appear above and below the 0 line like the example: I am getting this:
RGriffiths
  • 5,722
  • 18
  • 72
  • 120
0
votes
1 answer

error in creating more charts in looping - php

I'm trying to create country based charts. i'm using pchart for this, because it will create charts as image by default. I've created a function which creates barchart. I'm selecting countries and its stats and passing it to the barchart function…
vkGunasekaran
  • 6,668
  • 7
  • 50
  • 59
0
votes
1 answer

PHP pchart 2.0 Additional labels aligned with each bar

Hi I have a pChart 2 bar chart which contains a variable number of bars and as well as the actual value for each bar I wish to display 2 additional values to the right hand side of each bar. Please consider the image below where the values in the…
Gavin
  • 2,153
  • 2
  • 25
  • 35
0
votes
0 answers

pChart Library and PHP: class pDraw not found although it exists

I want to use the pChart Library (https://github.com/bozhinov/pChart2.0-for-PHP7) to draw some graphs based on a MySQL Dataset. Therefore I'm including a PHP file which contains the MySQL Query and the pChart code for drawing the graphs in another…
bear87
  • 83
  • 1
  • 11
0
votes
3 answers

php pchart pie chart problem with 0 value

I have a problem with my pie chart when I have 0 values $MyData->addPoints(array(10,20,20,15,23),"Data"); This works fine and converts to percentages across a pie chart however if any of these values are 0 which could happen as I'm dealing with…
user391986
  • 29,536
  • 39
  • 126
  • 205
0
votes
1 answer

pChart drawStackedBarChart setting the bar size property

I am using pChart drawStackedBarChart to generate a series of charts. I can't seem to find the setting that sets the height of the bar. As shown below the bar with the single bar chart is very thin. Any ideas how to set this property? The chart…
RGriffiths
  • 5,722
  • 18
  • 72
  • 120
0
votes
1 answer

pChart working at host server but not XAMPP: Uncaught Error: Cannot use string offset as an array

I am using pChart to generate some charts and this working fine when run at the server but when I run the same on XMAPP I get this error: Warning: Cannot assign an empty string to a string offset in ...\pDraw.class.php on line 4990 Fatal error:…
RGriffiths
  • 5,722
  • 18
  • 72
  • 120
0
votes
3 answers

pChart 2.x graph plots scale using decimals instead of whole numbers

I'm working on stats containing a number of visits and the scale on pChart is showing decimals instead of whole integers. The default setting is creating scales with fractions similar to below: 0 0.2 0.4 0.6 0.8 1.0 …
mblk
  • 1
  • 1
  • 2
0
votes
2 answers

Abscissa point placement in pChart - values, not labels

Using pChart to draw plot graphs: $Data = new pData(); $Data->AddPoints(array(1,2,10), 'x'); $Data->AddPoints(array(6,8,3), 'y'); $Data->setAbscissa('x'); $Chart = new pImage($w, $h, $Data); $Chart->setGraphArea(100, 0, $w-1, $h-50); …
Seva Alekseyev
  • 59,826
  • 25
  • 160
  • 281
0
votes
0 answers

I used pchart created a piechart by "pPie". but using "base64_encode" to encode the png image.I got a wrong code

I used pchart created a piechart by "pPie". and used "base64_encode" to encode the png image. $code = base64_encode(file_get_contents($image_path)); $html = $html . "\n"; The html can't…
Hanamaki
  • 29
  • 1
  • 2