如何在剑道角度网格内添加迷你图?

时间:2019-06-21 14:32:54

标签: angular typescript charts kendo-ui sparklines

我正在尝试使网格中的第一列显示项目符号图。

<kendo-grid-column>
    <ng-template kendoChartSeriesTooltipTemplate let-value="value">
      <div>
        <kendo-sparkline [data]="bulletData" type="bullet" [valueAxis]="bulletValueAxis">
        </kendo-sparkline>
      </div>
    </ng-template>
  </kendo-grid-column>

 public bulletData: any[] = [21, 23];
  public bulletValueAxis: any = {
    min: 0,
    max: 30,
    plotBands: [{
      from: 0, to: 15, color: "#787878", opacity: 0.15
    }, {
      from: 15, to: 22, color: "#787878", opacity: 0.3
    }, {
      from: 22, to: 30, color: "#787878", opacity: 0.15
    }]
  };

该列未显示任何内容。它只是空的。

1 个答案:

答案 0 :(得分:0)

ng-template中使用的指令是kendoGridCellTemplate,用于在第一列(而不是kendoChartSeriesTooltipTemplate)中显示图表。

此外,请确保您import 'hammerjs';

在此处查看完整的Stackblitz示例:

https://stackblitz.com/edit/angular-bxspfv