【问题标题】:Change the link color of ngx--graph改变ngx--graph的链接颜色
【发布时间】:2021-01-17 07:03:05
【问题描述】:

在 ngx-graph 上,是否可以更改链接模板?如果是,如何更改链接的颜色。默认为黑色。

    <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>

【问题讨论】:

    标签: angular svg d3.js graph ngx-graph


    【解决方案1】:

    我自己找到了答案。也许它对某人有用。

    只需设置笔画值。

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

    【讨论】:

      猜你喜欢
      • 2015-05-08
      • 1970-01-01
      • 2018-05-14
      • 2020-06-28
      • 2023-04-04
      • 2018-12-20
      • 1970-01-01
      • 2014-03-09
      • 1970-01-01
      相关资源
      最近更新 更多