Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting bgcolor attribute not possible #22

Closed
flaushi opened this issue Feb 2, 2018 · 1 comment
Closed

Setting bgcolor attribute not possible #22

flaushi opened this issue Feb 2, 2018 · 1 comment
Labels

Comments

@flaushi
Copy link

flaushi commented Feb 2, 2018

Hi,
I am quite happy with the simple interface of this lib. However, when trying to change my outputs background color, I run into problems:

$g = new Graph();
        $v = $dc->buildGraph($g);
        $graphviz = new GraphViz();
        $graphviz->setFormat('svg');
        $g->setAttribute('graphviz.bgcolor', 'green');
        var_dump ($graphviz->createScript($g));

gives:

digraph G {   0 [label="/"]   1 [label="erloes21" color="red"]   2 [label="erloes2gesamt" color="red"]   0 -> 1   0 -> 2 }  [] []

and the output has white background.

@clue clue added the question label Oct 6, 2018
@clue
Copy link
Member

clue commented Oct 6, 2018

@flaushi Very good question! All graphviz graph attributes have to be added like this:

$graph = new Graph();
$graph->setAttribute('graphviz.graph.bgcolor', 'green');

I'll make sure this gets added to the readme once we tackle #2 +1

@clue clue closed this as completed Oct 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants