【问题标题】:Echarts not rendered inside GridsterEcharts 未在 Gridster 中渲染
【发布时间】:2022-09-30 19:21:38
【问题描述】:

我有一个非常奇怪的问题。我在 Angular 应用程序中实现了 echarts && gridster。 所以echarts就像一个魅力,没有任何问题,gridster也是。

但是,一旦我将 echart 元素放入 gridster 项目中,就不会渲染 echart。 Gridster 项目具有宽度和高度,如果我将任何其他 html 元素放在 gridster 项目中,效果很好,只是拒绝显示 echars。

有谁知道这里有什么问题? 这是我的 HTML 顺便说一句..

<!-- Here echart is rendered -->
<div echarts *ngIf=\"widget[0].options\" [options]=\"widget[0].options\" class=\"echart\"></div>

<gridster #gridStack [options]=\"options\">

  <gridster-item gridster-item [item]=\"widget.gridster\" *ngFor=\"let widget of widgets\">

    <div class=\"header\">
      <div>{{widget.name}}</div>
      <div>
        <mat-icon (click)=\"exportWidget(widget, true, true);\">download</mat-icon>
        <mat-icon (click)=\"goToLink(widget.navigation);\" *ngIf=\"widget.navigation\">launch</mat-icon>
        <mat-icon (click)=\"openUpdateWidget(widget);\">settings</mat-icon>
      </div>
    </div>

    <div>
      Some content. It\'s rendered!
    </div>

     <!-- HERE IS NOT RENDERED -->
    <div echarts *ngIf=\"widget.options\" [options]=\"widget.options\" class=\"echart\"></div> 
    <!-- CONFIG IS OK! -->
    <pre>{{widgets.options| json}}</pre>


  </gridster-item>

</gridster>

    标签: angular echarts gridster


    【解决方案1】:

    面临同样的问题!如果您找到解决方法,请告诉我

    【讨论】:

    • Vidit Sood,请不要添加我也是作为答案。它实际上并没有提供问题的答案。如果你有一个不同但相关的问题,那么ask它(如果它有助于提供上下文,请参考这个问题)。如果您对这个特定问题感兴趣,您可以upvote 它,留下comment,或者在您有足够的reputation 时启动bounty
    猜你喜欢
    • 1970-01-01
    • 2023-02-04
    • 1970-01-01
    • 1970-01-01
    • 2020-11-15
    • 1970-01-01
    • 2019-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多