Multiple color for Custom Relationship Triple


just gone through above link. Could you please help me with the option to give three different colours for three different lines in Triple Style as in below pattern I am able to pass only one color.

definePathPattern(“TripleR”, “M0 0 L1 0 M0 3 L1 3 M0 6 L1 6”, “red”);

Use a Linear gradient Brush in the Shape.pathPattern Shape instead of a solid color. For example:

    myDiagram.linkTemplate =
            stroke: "transparent", strokeWidth: 6,  // to make it pickable
                  geometryString: "M0 0 L1 0 M0 3 L1 3 M0 6 L1 6",
                  fill: "transparent",
                  stroke: $(go.Brush, go.Brush.Linear, { 0: "red", 0.5: "green", 1: "blue" }),
                  strokeCap: "square"


Many Thanks Walter. It worked.