Abdul K Shahid
Abdul K Shahid

Reputation: 538

Change the link color of ngx--graph

on the ngx-graph, is it possible to change the link template?. if yes, how to change the color of the links. By default, it is black.

    <ng-template #linkTemplate let-link>
        <svg:g class="edge"
               [attr.fill-opacity]="0.4"
        >
            <svg:path
                    [attr.fill]="'red'"
                    [attr.color]="'red'"
                    class="line"
                    marker-end="url(#arrow)"
                    stroke-width="2"
                    style="fill: green">
            </svg:path>
            <svg:text class="edge-label" text-anchor="middle">
                <textPath [attr.href]="'#' + link.id" [style.dominant-baseline]="link.dominantBaseline"
                          class="text-path" startOffset="80%">
                    {{link.label}}
                </textPath>
            </svg:text>
        </svg:g>
    </ng-template>

Upvotes: 0

Views: 1195

Answers (1)

Abdul K Shahid
Abdul K Shahid

Reputation: 538

I have found the answer for this myself. maybe its useful for someone.

just set the stroke value.

<svg:path
                    class="line"
                    marker-end="url(#arrow)"
                    stroke-width="2"
                    stroke='red'">
</svg:path>

Upvotes: 2

Related Questions