473,508 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Image_Graph line weight question

Hey guys,

I've been putting together a line graph in Image_Graph. And I can't
seem to find an answer to change the layout of few things.

Here is my graph: http://www.goldreads.com/test.png

1) I'm trying to bold the line.
2) I would also like to make the title bold...
3) I want to include a text inside the graph in the right corner

I would appreciate if anyone knows the answer.

Here is my code:

<?php
require_once 'Image/Graph.php';
require_once 'Image/Canvas.php';
$Canvas =& Image_Canvas::factory('png', array('width' =172, 'height'
=114, 'antialias' =false));
$Graph =& Image_Graph::factory('graph', $Canvas);
//$Graph =& Image_Graph::factory('graph', array(172, 114));

$Font =& $Graph->addNew('ttf_font', 'Arial');
// set the font size to 15 pixels
$Font->setSize(8);

$Graph->setFont($Font);

$Graph->add(
Image_Graph::vertical(
$Title = Image_Graph::factory('title', array('Dow/Gold Ratio:
Daily', 9)),
Image_Graph::vertical(
$Plotarea = Image_Graph::factory('plotarea'),
$Legend = Image_Graph::factory('title', array('Jul
08, 2008 18:16 EST', 8)),
90
),
10
)
);
//$Legend->setPlotarea($Plotarea);

//$Plotarea =& $Graph->addNew('plotarea', array('axis','axis'));
//$Legend->setPadding(-10);
//$Title->setFontColor('red');
$Plotarea->setPadding(2);

$Dataset =& Image_Graph::factory('dataset');
$Dataset->addPoint("06.08", 10);
$Dataset->addPoint("06.09", 3);
$Dataset->addPoint("06.11", 8);
$Dataset->addPoint("06.12", 5);
$Dataset->addPoint("06.13", 4);
$Dataset->addPoint("06.14", 3);
$Dataset->addPoint("06.17", 8);
$Dataset->addPoint("06.18", 5);
$Dataset->addPoint("06.19", 4);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_X);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_Y);

$Plot =& $Plotarea->addNew('smooth_line', array(&$Dataset));
$Plot->setLineColor('red');
$Plot->setThickness(2);
//$Plot->setTitle('Daily Dow/Gold Ratio');

$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
//$AxisX->setPadding(0);
//$AxisX->setLabelInterval(array("Jan","Apr","Jun"));

//$AxisX->setFontAngle('vertical');
$AxisX->setLabelInterval(2);
//$Graph->setPadding(10);
$Graph->done(array('filename' ='test.png'));

?>
Jul 9 '08 #1
3 3051
go*******@gmail.com wrote:
Hey guys,

I've been putting together a line graph in Image_Graph. And I can't
seem to find an answer to change the layout of few things.

Here is my graph: http://www.goldreads.com/test.png

1) I'm trying to bold the line.
2) I would also like to make the title bold...
3) I want to include a text inside the graph in the right corner

I would appreciate if anyone knows the answer.

Here is my code:

<?php
require_once 'Image/Graph.php';
require_once 'Image/Canvas.php';
$Canvas =& Image_Canvas::factory('png', array('width' =172, 'height'
=114, 'antialias' =false));
$Graph =& Image_Graph::factory('graph', $Canvas);
//$Graph =& Image_Graph::factory('graph', array(172, 114));

$Font =& $Graph->addNew('ttf_font', 'Arial');
// set the font size to 15 pixels
$Font->setSize(8);

$Graph->setFont($Font);

$Graph->add(
Image_Graph::vertical(
$Title = Image_Graph::factory('title', array('Dow/Gold Ratio:
Daily', 9)),
Image_Graph::vertical(
$Plotarea = Image_Graph::factory('plotarea'),
$Legend = Image_Graph::factory('title', array('Jul
08, 2008 18:16 EST', 8)),
90
),
10
)
);
//$Legend->setPlotarea($Plotarea);

//$Plotarea =& $Graph->addNew('plotarea', array('axis','axis'));
//$Legend->setPadding(-10);
//$Title->setFontColor('red');
$Plotarea->setPadding(2);

$Dataset =& Image_Graph::factory('dataset');
$Dataset->addPoint("06.08", 10);
$Dataset->addPoint("06.09", 3);
$Dataset->addPoint("06.11", 8);
$Dataset->addPoint("06.12", 5);
$Dataset->addPoint("06.13", 4);
$Dataset->addPoint("06.14", 3);
$Dataset->addPoint("06.17", 8);
$Dataset->addPoint("06.18", 5);
$Dataset->addPoint("06.19", 4);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_X);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_Y);

$Plot =& $Plotarea->addNew('smooth_line', array(&$Dataset));
$Plot->setLineColor('red');
$Plot->setThickness(2);
//$Plot->setTitle('Daily Dow/Gold Ratio');

$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
//$AxisX->setPadding(0);
//$AxisX->setLabelInterval(array("Jan","Apr","Jun"));

//$AxisX->setFontAngle('vertical');
$AxisX->setLabelInterval(2);
//$Graph->setPadding(10);
$Graph->done(array('filename' ='test.png'));

?>
Image_Graph doesn't look like it's being developed any more. The last
release was an alpha version over two years ago, there is virtual no
documentation and it has unassigned bugs almost three years ago.

I doubt anyone else is using it - and I sure wouldn't, especially for
production code.

I'd suggest you check out other packages. jpgraph comes to mind, but
I'm sure there are others.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 9 '08 #2
On Jul 9, 3:22*am, Jerry Stuckle <jstuck...@attglobal.netwrote:
goldre...@gmail.com wrote:
Hey guys,
I've been putting together a line graph in Image_Graph. And I can't
seem to find an answer to change the layout of few things.
Here is my graph:http://www.goldreads.com/test.png
1) I'm trying to bold the line.
2) I would also like to make the title bold...
3) I want to include a text inside the graph in the right corner
I would appreciate if anyone knows the answer.
Here is my code:
<?php
require_once 'Image/Graph.php';
require_once 'Image/Canvas.php';
$Canvas =& Image_Canvas::factory('png', array('width' =172, 'height'
=114, 'antialias' =false));
$Graph =& Image_Graph::factory('graph', $Canvas);
//$Graph =& Image_Graph::factory('graph', array(172, 114));
$Font =& $Graph->addNew('ttf_font', 'Arial');
// set the font size to 15 pixels
$Font->setSize(8);
$Graph->setFont($Font);
$Graph->add(
* *Image_Graph::vertical(
* * * * * * $Title = Image_Graph::factory('title', array('Dow/Gold Ratio:
Daily', 9)),
* * * * * * * * *Image_Graph::vertical(
* * * * * * * * * $Plotarea = Image_Graph::factory('plotarea'),
* * * * * * * * * $Legend = Image_Graph::factory('title', array('Jul
08, 2008 18:16 EST', 8)),
* * * * * * * * * 90
* * * * * * * * *),
* * * * * * * * *10
* * * * )
);
//$Legend->setPlotarea($Plotarea);
//$Plotarea =& $Graph->addNew('plotarea', array('axis','axis'));
//$Legend->setPadding(-10);
//$Title->setFontColor('red');
$Plotarea->setPadding(2);
$Dataset =& Image_Graph::factory('dataset');
$Dataset->addPoint("06.08", 10);
$Dataset->addPoint("06.09", 3);
$Dataset->addPoint("06.11", 8);
$Dataset->addPoint("06.12", 5);
$Dataset->addPoint("06.13", 4);
$Dataset->addPoint("06.14", 3);
$Dataset->addPoint("06.17", 8);
$Dataset->addPoint("06.18", 5);
$Dataset->addPoint("06.19", 4);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_X);
$Plotarea->addNew('line_grid', false, IMAGE_GRAPH_AXIS_Y);
$Plot =& $Plotarea->addNew('smooth_line', array(&$Dataset));
$Plot->setLineColor('red');
$Plot->setThickness(2);
//$Plot->setTitle('Daily Dow/Gold Ratio');
$AxisX =& $Plotarea->getAxis(IMAGE_GRAPH_AXIS_X);
//$AxisX->setPadding(0);
//$AxisX->setLabelInterval(array("Jan","Apr","Jun"));
//$AxisX->setFontAngle('vertical');
$AxisX->setLabelInterval(2);
//$Graph->setPadding(10);
$Graph->done(array('filename' ='test.png'));
?>

Image_Graph doesn't look like it's being developed any more. *The last
release was an alpha version over two years ago, there is virtual no
documentation and it has unassigned bugs almost three years ago.

I doubt anyone else is using it - and I sure wouldn't, especially for
production code.

I'd suggest you check out other packages. *jpgraph comes to mind, but
I'm sure there are others.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================- Hide quoted text -

- Show quoted text -
Thanks a lot Jerry, I'll look into jdgraph.
Jul 10 '08 #3
Message-ID:
<e6**********************************@x35g2000hsb. googlegroups.comfrom
Markus contained the following:
>Thanks a lot Jerry, I'll look into jdgraph.
Me, I'd look at jpgraph. ;-)

--
Geoff Berrow 0110001001101100010000000110
001101101011011001000110111101100111001011
100110001101101111001011100111010101101011
Jul 10 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1783
by: Greg Bryant | last post by:
I'm a bit confused about image_graph - I'm just trying to create a line graph with multiple lines, be able to assign the text for the x and y ticks and colors for the lines. A legend would be...
9
4159
by: PinkBishop | last post by:
I have included my .css script below. This is my first attempt at CSS. The pages look fine through they eyes of PC browsers and NS on the Mac. On IE and Safari for Mac all hell breaks...
5
3020
by: Shawn Hamzee | last post by:
Hello All, I am having a problem with Image_Graph on php 5.1.4. I installed the package and all of its dependencies through pear installer without any hitches. Then I started to add some very...
0
1124
by: Lorenzo Thurman | last post by:
I need to use it to produce presentation graphics. I'm still working my way through the docs, but could use some assistance with the following: I need a way to have Image_Graph output graphs via a...
11
4834
by: alpha.beta0 | last post by:
I have a MySQL table of servers, I use RAND() to pick a random server to use each time, but how can I add a number to each server entry that allows it be to picked more often than the other 20...
2
2804
by: Lorenzo Thurman | last post by:
I keep getting this error when trying to use fonts with Image_Graph: PHP Fatal error: Call to undefined function: imagettfbbox() in /usr/local/lib/php/Image/Canvas/GD.php on line 1240 After...
0
1170
by: Lorenzo Thurman | last post by:
How do I tell Image_Graph(or Freetype) where to look for fonts? They were installed under /usr/local/, but I still get an error when calling a font. I can hard code the path to the font, so it...
0
1336
by: Lorenzo Thurman | last post by:
I didn't get any replies the first time, so I'm trying again: How do I tell Image_Graph(or Freetype) where to look for fonts? They were installed under /usr/local/, but I still get an error when...
0
2565
by: WaluigiCubed | last post by:
Hi all, I'm designing a phone application using J2ME that uses the Open Source Diamond Powder methodology. The below getSchema method will eventually read in data to build screens on the phone...
0
7227
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7127
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7331
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7054
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5056
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3204
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3188
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1564
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
424
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.