Graphviz installation

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
ab
Posts: 7
Joined: 18 May 2006, 08:38

Graphviz installation

Post by ab »

I want to install graphviz.

I've found the page where the graph will be show: "bug_relationship_graph.php ". But i don't find where this page is called. Where is the link to go on this page ?

I have to create the link where i want ?
ab
Posts: 7
Joined: 18 May 2006, 08:38

Post by ab »

Sorry, Mantis version : 1.0.a2
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

The link to the bug relationship graph should automatically be enabled on the 'view issue' page, so long as you've enabled relationships.

Make sure that you have:
$g_relationship_graph_enable = ON;

added to your config_inc.php page.

Also, graphs are used in certain summary pages (Summary > Advanced summary for example).

Hope this helps,
Lincoln.
ab
Posts: 7
Joined: 18 May 2006, 08:38

Post by ab »

error
Last edited by ab on 19 May 2006, 09:06, edited 1 time in total.
ab
Posts: 7
Joined: 18 May 2006, 08:38

Post by ab »

Thank you for your help.

The link is not created automatically on my version but i've created it on the issue view page.

I want now to create new graphs.

I've done that but it doesn't work :

<?php
$t_graph = new Digraph( );

$t_graph->set_default_node_attr( array (
'fontname' => $t_graph_fontname,
'fontsize' => $t_graph_fontsize,
'shape' => 'record',
'style' => 'filled',
'height' => '0.2',
'width' => '0.4'
) );

$t_graph->set_default_edge_attr( array (
'style' => 'solid',
'color' => '#C00000',
'dir' => 'back'
) );

$t_graph->add_node( 'Cinq' );
$t_graph->add_node( 'Six' );
$t_graph->add_edge( 'Cinq', 'Six' );

$t_graph->generate();

?>
<div class="center relationship-graph">
<img src="<?php echo $t_graph ?>"/>
</div>

What is the problem, and what i've to do ?
Narcissus
Developer
Posts: 338
Joined: 17 Feb 2005, 09:45

Post by Narcissus »

The problem is basically this:

Your $t_graph is a graph object, but you're trying to assign that value to the 'img src' value in the HTML: 'img src' is meant to point to a path, not the image data itself.

Imagine a normal image. In the HTML, you set 'img src' to point to that image, you don't dump the actual image data straight in to 'img src'!

I'm hoping you're following me :)

If you look at the other graphs in Mantis, you will see that they're 'broken up' into two parts: you have one PHP file that creates just the HTML. Here, the 'img src' for the various graphs point to another PHP file, which creates just the image.

You need to do that, basically...
ab
Posts: 7
Joined: 18 May 2006, 08:38

Graphviz installation

Post by ab »

Thank you very much for your help. I've found my errors and i'm arrived to make the graphs that i want...

I can continue my work on my Mantis version !
konstb
Posts: 5
Joined: 01 Feb 2008, 11:14

Re: Graphviz installation

Post by konstb »

Hello, following to your suggestion, I created two files:
img1.php

Code: Select all

<?php
require_once( 'graphviz_api.php' );

$t_graph = new Digraph( );

$t_graph->set_default_node_attr( array (
'fontname' => 'Arial',
'fontsize' => 8,
'shape' => 'record',
'style' => 'filled',
'height' => '0.2',
'width' => '0.4'
) );

$t_graph->set_default_edge_attr( array (
'style' => 'solid',
'color' => '#C00000',
'dir' => 'back'
) );

$t_graph->add_node( 'Cinq' );
$t_graph->add_node( 'Six' );
$t_graph->add_edge( 'Cinq', 'Six' );

$t_graph->output('png',true);
# or $t_graph->output('png',false); - does not matter
?>
and img0.php:

Code: Select all

<body>
<img src="img1.php"/>
</body>
If I run on the server "php img1.php > 1.png"
I got the normal 1.PNG image, that can be displayed, but when I try to access to img0.php through the www server Apache, I've got the broken image.
Any ideas, why?
Post Reply