我正在使用GetOrgChart为我的公司制作组织结构图,但我遇到了一个小问题.
如果SVG它比容器大,我们希望添加一个滚动条,以便您可以使用它滚动,因为这比用鼠标拖动它要快得多.
我试过这个例子但是无法使它工作.
有没有办法实现我正在寻找的东西?
下面的示例比我们的实际图表小,但它应该足以表示问题.
var peopleElement = document.getElementById("people");
var orgChart = new getOrgChart(peopleElement, {
primaryFields: ["name", "title", "phone", "mail"],
photoFields: ["image"],
scale: 0.4,
dataSource: [{
id: 1,
parentId: null,
name: "Amber McKenzie",
title: "CEO",
phone: "678-772-470",
mail: "lemmons@jourrapide.com",
adress: "Atlanta, GA 30303",
image: "images/f-11.jpg"
},
{
id: 2,
parentId: 1,
name: "Ava Field",
title: "Paper goods machine setter",
phone: "937-912-4971",
mail: "anderson@jourrapide.com",
image: "images/f-10.jpg"
},
{
id: 3,
parentId: 1,
name: "Evie Johnson",
title: "Employer …Run Code Online (Sandbox Code Playgroud)我从这里使用getOrgChart库,我试图打印出整个图表而不仅仅是可见部分.不幸的是,当使用标准库打印功能时,它只打印出第一部分,我无法弄清楚如何打印整个图表(这是非常宽的,大约200个节点水平移动).即使它跨越几页我也不介意.
我已经尝试了一些像svgToPdf,jsPDF这样的库,我知道有像Phantom这样的服务器端替代品,但我不确定最好的方法以及最容易让我的SVG标签完全打印.