小编Ale*_*ruk的帖子

GoJS:如何更改节点填充颜色?

我正在使用 GoJS 制作图表。

我的图表配置(来自官方文档的示例):

function init() {
    //......
    // define the Node template
    myDiagram.nodeTemplate =
        $(go.Node, "Auto",
            new go.Binding("location", "loc", go.Point.parse).makeTwoWay(go.Point.stringify),
            // define the node's outer shape, which will surround the TextBlock
            $(go.Shape, "RoundedRectangle",
                {
                    parameter1: 20,  // the corner has a large radius
                    fill: $(go.Brush, "Linear", { 0: "rgb(254, 201, 0)", 1: "rgb(254, 162, 0)" }),
                    stroke: null,
                    portId: "",  // this Shape is the Node's port, not the whole Node
                    fromLinkable: true, fromLinkableSelfNode: true, fromLinkableDuplicates: true,
                    toLinkable: true, …
Run Code Online (Sandbox Code Playgroud)

javascript diagram fill nodes gojs

5
推荐指数
1
解决办法
4147
查看次数

标签 统计

diagram ×1

fill ×1

gojs ×1

javascript ×1

nodes ×1