Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

How to update link strokeDashArray by link text

$
0
0

@dxxzst wrote:

I want to set different line styles according to different line texts.
Below is my code

myDiagram.linkTemplate = $$(go.Link, {
                //curve: go.Link.Bezier,
                toShortLength: 8,
                toEndSegmentLength: 20
            },
            $$(go.Shape, {strokeWidth: 2, stroke: "grey", strokeDashArray: []}),
            $$(go.Shape, {toArrow: "Triangle", fill: "grey", stroke: null}),
            $$(go.TextBlock, "", {
                textAlign: "center",
                stroke: "#2F4F4F"
            }, new go.Binding("text", "text", function (text, link) {
                if(text === 'something'){
                   **//update  link strokeDashArray here**
                    console.log(link);
                }
            }))
        );

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles