`

graphviz + php 画图

阅读更多

header("Content-type:image/png;");

$content = "digraph call_graph{

N1[shape=polygon,sides=6,label=\"A\",width=1, fontsize=15,style=filled,fillcolor=red]; N2[shape=polygon,sides=5,label=\"b\" ,width=1,fontsize=14 ,style=filled,fillcolor=yellow]; N3[shape=polygon,sides=5,label=\"c\" ,width=1,fontsize=14 ,style=filled,fillcolor=yellow]; N4[shape=polygon,sides=5,label=\"d\" ,width=1,fontsize=14 ,style=filled,fillcolor=yellow]; N1->N2[arrowsize=2.0,label=\"out\",headlabel=\"2\",taillabel=\"2\"];

N2->N3[arrowsize=2.0,label=\"out\",headlabel=\"2\",taillabel=\"2\"];

N3->N4[arrowsize=2.0,label=\"out\",headlabel=\"2\",taillabel=\"2\"];

N4->N2[arrowsize=2.0,label=\"out\",headlabel=\"2\",taillabel=\"2\"];

}";

 

passthru("echo \"$content\"|dot -Tpng");

 



 

 

  • 大小: 17.5 KB
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics