473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Jpgraph : Set Value Y-AXIS

Dear list, i am new to this forum and to JPGraph too. I just install jpgraph to create a graphic to my website. But i got error.

Here is the complete code :

First is MySQL Database : ( 2 tables) :

1. Table : Hesk_Categories

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `hesk_categories` (
  2.   `id` int(5) unsigned NOT NULL auto_increment,
  3.   `name` varchar(60) NOT NULL default '',
  4.   `cat_order` smallint(5) unsigned NOT NULL default '0',
  5.   PRIMARY KEY  (`id`)
  6. ) TYPE=MyISAM AUTO_INCREMENT=6 ;
  7.  
  8. #
  9. # Dumping data for table `hesk_categories`
  10. #
  11.  
  12. INSERT INTO `hesk_categories` VALUES (1, 'Komputer', 10);
  13. INSERT INTO `hesk_categories` VALUES (4, 'Customer Services Problem', 20);
  14. INSERT INTO `hesk_categories` VALUES (5, 'Treasury Problem', 30);
  15.  
  16.  
2. Table Hesk_Tickets

Expand|Select|Wrap|Line Numbers
  1. CREATE TABLE `hesk_tickets` (
  2.   `id` mediumint(8) unsigned NOT NULL auto_increment,
  3.   `trackid` varchar(10) NOT NULL default '',
  4.   `name` varchar(50) NOT NULL default '',
  5.   `email` varchar(50) NOT NULL default '',
  6.   `category` smallint(5) unsigned NOT NULL default '1',
  7.   `priority` enum('1','2','3') NOT NULL default '3',
  8.   `subject` varchar(70) NOT NULL default '',
  9.   `message` text NOT NULL,
  10.   `dt` varchar(25) NOT NULL default '0000-00-00 00:00:00',
  11.   `lastchange` varchar(25) NOT NULL default '0000-00-00 00:00:00',
  12.   `ip` varchar(20) NOT NULL default '',
  13.   `status` enum('0','1','2','3') default '1',
  14.   `lastreplier` enum('0','1') NOT NULL default '0',
  15.   `archive` enum('0','1') NOT NULL default '0',
  16.   `attachments` text,
  17.   `custom1` varchar(255) NOT NULL default '',
  18.   `custom2` varchar(255) NOT NULL default '',
  19.   `custom3` varchar(255) NOT NULL default '',
  20.   `custom4` varchar(255) NOT NULL default '',
  21.   `custom5` varchar(255) NOT NULL default '',
  22.   PRIMARY KEY  (`id`),
  23.   KEY `trackid` (`trackid`),
  24.   KEY `archive` (`archive`)
  25. ) TYPE=MyISAM AUTO_INCREMENT=36 ;
  26.  
  27. #
  28. # Dumping data for table `hesk_tickets`
  29. #
  30.  
  31. INSERT INTO `hesk_tickets` VALUES (34, 'WMW', 'tes', 'tes@tes.com', 1, '3', 'fdf', 'gfdsg', '19 July 2007, 4:14 PM', '20 July 2007, 1:55 PM', '172.32.30.121', '2', '1', '0', '', '', '', '', '', '');
  32. INSERT INTO `hesk_tickets` VALUES (35, '6PE', 'Waode Rahmawaktu', 'waode.rahmawaktu@gmail.com', 1, '1', 'Monitor Mati', 'Dear helpdesk, <br />\r\n<br />\r\nPagi ini saya sudah mencoba menyalakan komputer saya beberapa kali. Komputernya hidup, tapi layar monitornya tidak bisa menampilkan tampilan dari program komputer. Padahal monitor tersebut sudah dinyalakan (kabel juga sudah dicolokin ke tempat colokan listrik). Kok ga bisa nyala ya? Apa monitornya yang rusak? Saya belum bisa mencoba diganti dengan monitor lain karena ga ada monitor yang tidak terpakai, semuanya terpakai. Tolong donk bagian TSI nya ke sini , dibenerin gitu monitor gue.  <br />\r\n<br />\r\nThanks', '20 July 2007, 9:40 AM', '20 July 2007, 11:28 AM', '172.32.30.121', '3', '1', '0', '', '', '', '', '', '');
  33.  
And the PHP CODE is here :

[PHP]
<?php
include ("jpgraph/src/jpgraph.php");
include ("jpgraph/src/jpgraph_bar.php");

$db = mysql_connect("localhost", "root","root") or die(mysql_error());

mysql_select_db("helpdeskSULTRA",$db) or die(mysql_error());

$sql = mysql_query("SELECT * FROM hesk_categories") or die(mysql_error());


while($row=mysql_fetch_array($sql))
{

$leg[]=$row[1];
$idkat=$row[0];

$sql_tiket=mysql_query("SELECT COUNT(*) FROM hesk_tickets WHERE category=$idkat");

$data[] = $sql_tiket;

}

$graph = new Graph(250,150,"auto");
$graph->SetScale("textint");
$graph->img->SetMargin(50,30,50,50);

$graph->SetShadow();

$graph->xaxis->SetTickLabels($leg);

$bplot = new BarPlot($data);
$bplot->SetFillColor("lightgreen"); // Fill color
$bplot->value->Show();
$bplot->value->SetFont(FF_ARIAL,FS_BOLD);
$bplot->value->SetAngle(45);
$bplot->value->SetColor("black","navy");

$graph->Add($bplot);
$graph->Stroke(); ?>

[/PHP]

The error message is :

Cannot use auto scaling since its imposible to determine a valid min/max value of y-axis(only null values)


My Need is : I want to display in a graphic about how many tickets in a category. Thanks for help!!
Jul 23 '07 #1
3 20934
Sorry, i found the solution . that just a wrong sql syntax. Thanks :)
Jul 23 '07 #2
kovik
1,044 Expert 1GB
You will need to check the JPGraph documentation for that error message. That error is produced by the application, not PHP.
Jul 23 '07 #3
pbmods
5,821 Expert 4TB
Heya, rahmawaktu. Welcome to TSDN!

Glad to hear you got it working! Good luck with your project, and if you ever need anything, post back anytime :)
Jul 24 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Leigh Riley | last post by:
Hi there, I've installed PHP on a variety of machines, but I seem to be having a lot of trouble on Windows XP. I have 4.3.2 installed, and I would like to use...
0
by: Andrew Rich | last post by:
anybody done linear regression with jpgraph ?
3
by: Jeff | last post by:
Could someone walk me step by step on how to install and get JpGraph running on a Windows 2000+Apache+PHP+MySql server? -Thanks Jeff
1
by: Frederes | last post by:
Hi, I use jpgraph library to make gannt graphs. I'd like to remove the box around the graph (of grey color) How to do then ? Thanks for any help Fred
3
by: JÿGius³ vs ::NRG::ius | last post by:
Hi all. How can I draw a table with jpgraph? I want a table as image. Thanks. G:
2
by: iulian.ilea | last post by:
Hi, I use JpGraph to generate some graphs and I have to include those graphs in a pdf file, generated usign fPDF (http://www.fpdf.org/). If I include a png file it's ok, the pdf file is...
0
by: kirke | last post by:
Perhaps someguys could know, I want to modify jpgraph. function StockPlot(&$datay,$datax=false) { $this->Plot($datay,$datax); $this->numpoints /= $this->iTupleSize; } this is original code...
0
by: luckyG | last post by:
I have php (5.2.4) compiled on redhat 4.0 as followed : ./configure \ --with-oci8=$ORACLE_HOME --with-apxs=/usr/local/apache/bin/apxs \ --with-config-file-path=/usr/local/apache/conf \ ...
2
by: paeh | last post by:
what's wrong for this php code. when I run did not display anything in browser.. this is code: <?php include ("C:/Program Files/Apache Software...
2
by: AARTHISUBBU | last post by:
i m quiet new to wamp... is it possible to run jpgraph codes in wamp... else i have to install jpgraph separately and to run?.. if i can run jpgraph codes in wamp,what i have to do? i m using...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.