There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate JavaScript, these two processes are very time-consuming. Especially in js rendering, most js versions are used to generate Divs, which is certainly slower. My method is,
There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate js again, these two processes are very time-consuming. In particular, the js rendering process, most js versions all generate p again, which will certainly be even slower. My method is,
There are a lot of open-source js version organization chart tools on the Internet, but suppose there is such a scenario, there is an xml file of more than 10 MB, which contains organizational relationships, which should be parsed using php, to generate js again, these two processes are very time-consuming. In particular, the js rendering process, most js versions all generate p again, which will certainly be even slower.
My method is to directly use php to output a corresponding html structure. I use a table with a certain structure and then use css to draw lines. The specific implementation method is OK by directly looking at the code. If you have any questions, you can discuss them. PHP-to-OrgChart
'; $size=count($arr); if($title!='') { //head echo ''; echo ''; echo ''.$title.'
'; echo ''; echo ''; //head line echo ''; echo ''; echo '
'; echo ''; echo ''; //line if($size>=2){ $tdWidth=((100)/($size*2)); echo ''; echo ''; echo ''; for($j=1; $j<$size-1; $j++) { echo ''; echo ''; } echo ''; echo ''; echo ''; } } // echo ''; foreach($arr as $key=>$value) { echo ''; if(is_array($value)) { PHPtoOrgChart($value,$key); } else { echo '
'.$value.'
'; } echo ''; } echo ''; // echo ''; }