繁体   English   中英

如果数据相对较小,Kendo 柱状图的栏不显示 -- Kendo Angular Chart

[英]Bar for Kendo Column Chart does not show if the data is relatively small -- Kendo Angular Chart

我遇到了一个场景,如果数据集的值比其他值小得多,则垂直条不会显示,但这不是条形图。 对于条形图,水平条出现在图表上。 尽管两个图表中的所有记录都出现了 Legends。

不确定这是预期的功能还是错误。

我为重现 QA 团队提出的错误而创建的示例代码。 任何帮助将不胜感激。

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
    <kendo-chart>
      <kendo-chart-title text="Units sold"></kendo-chart-title>
      <kendo-chart-category-axis>
          <kendo-chart-category-axis-item [categories]="['Q1', 'Q2', 'Q3', 'Q4']">
          </kendo-chart-category-axis-item>
      </kendo-chart-category-axis>
      <kendo-chart-series>

        <kendo-chart-series-item type="column" [data]="[120000, 67000, 231, 196000000]">
        </kendo-chart-series-item>

      </kendo-chart-series>
    </kendo-chart>

<h4> H-Bar Chart</h4>


    <kendo-chart>
      <kendo-chart-title text="Units sold"></kendo-chart-title>
      <kendo-chart-category-axis>
          <kendo-chart-category-axis-item [categories]="['Q1', 'Q2', 'Q3', 'Q4']">
          </kendo-chart-category-axis-item>
      </kendo-chart-category-axis>
      <kendo-chart-series>

        <kendo-chart-series-item type="bar" [data]="[120000, 67000, 231, 196000000]">
        </kendo-chart-series-item>

      </kendo-chart-series>
    </kendo-chart>
  `
})
export class AppComponent {
}

/ Stackblitz 相同/

https://stackblitz.com/edit/angular-w5c6ir?file=src%2Fapp%2Fapp.component.html

为可能遇到这种情况的人回答我自己的问题。 我已经向 Kendo 团队提出了这个问题,并知道这是一个错误。 截至目前,解决方法是禁用窗格的剪辑。

[窗格]="[{ 剪辑:假}]"

更新:在@progress/kendo-angular-charts 3.5.2 版本中得到了修复。

https://stackblitz.com/edit/angular-y6nkw1?file=app/app.component.ts

现在无需将剪辑设置为 false

stackblitz: https ://stackblitz.com/edit/angular-dvynmu ? file = src/app/app.component.html

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM