Adrielpin / gchartphp

Automatically exported from code.google.com/p/gchartphp
0 stars 0 forks source link

POST requests in the example do not work #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Visit view.html from a default install
2. See the broken images where the charts should be

I am unable to use POST requests with this library.  The images do not render 
when I visit view.html in the examples.

Original issue reported on code.google.com by eva...@gmail.com on 14 Oct 2010 at 5:38

GoogleCodeExporter commented 8 years ago
I think that I was able to replicate your problem.
Try to substitute the & with & in the <img> call.

Please let me know it this solve your issue.

Original comment by bardellie on 15 Oct 2010 at 12:41

GoogleCodeExporter commented 8 years ago
I do believe that was the issue.  As a workaround to getting POST requests to 
work, I used the output of getUrl() to create an array.  I then POSTed that 
data.  It did not work unless substituted "&" for "&".  It would be great if 
this were changed in the source so that renderImage would work.

Thanks

Original comment by eva...@gmail.com on 19 Oct 2010 at 12:13

GoogleCodeExporter commented 8 years ago
I am using this piece of code to use the array of employee number retrieved 
from my oracle database to construct the line chart. However, all I see is a 
horizontal line in at the maximum y-axis value.

<?php
require_once("gChart.php");
$lineChart = new gLineChart(300, 200);
//my query
$query1 = "select o.CUSTOMER_NO, ceil(TOTAL_AMT/100000) hundred_thou
from oes2a.customer join oes2a.orders o on customer.customer_no=o.customer_no
order by total_amt desc";

// I have a database connection, and query execution code here..

while (($row = oci_fetch_array($s, OCI_BOTH))) {
    // Use the uppercase column names for the associative array indices
    $arr1[] = $row[0];
    $arr2[] = $row[1];
}

$lineChart->addDataSet($arr1);
$lineChart->setLegend(array('Total Amount'));
$lineChart->setColors(array('ED237A'));
$lineChart->setVisibleAxes(array('x','y'));
$lineChart->setDataRange(0,100);
$lineChart->setLegendPosition('t');
// axisnr, from, to, step
$lineChart->addAxisRange(0,0,500);
$lineChart->addAxisRange(1,0,100);

$lineChart->setGridLines(25,10);
$lineChart->renderImage(true);
?>

Original comment by pkrl2...@gmail.com on 21 Feb 2011 at 4:29