Skip to content

Kendo Chart - series is not painted when ng-content is used #2462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SchneiderMK opened this issue Sep 3, 2019 · 1 comment
Closed

Kendo Chart - series is not painted when ng-content is used #2462

SchneiderMK opened this issue Sep 3, 2019 · 1 comment

Comments

@SchneiderMK
Copy link

Describe the bug
The chart serie will not draw correctly if the chart is used into a component that use ng-content (transclusion).

To Reproduce
Steps to reproduce the behavior:

  1. open StackBlitz example: https://stackblitz.com/edit/kendo-chart-refresh-error
  2. Click the "Load" Button -> Chart is painted correctly
  3. Click the "Load" Button again -> Chart is hided by the parent component (No data)
  4. Click the "Load" Button again -> Chart is painted but no series are visible

When the browser is resized (chart refresh) the serie is getting painted.

Expected behavior
Chart should always paint the series if data is available.

Screenshots
Step 2:
image

Step 3:
image

Step 4 (Error, series not visible):
image

Browser

  • OS: Windows 10
  • Browser: Chrome
  • Version: 76.0.3809.132
@danielkaradachki
Copy link
Contributor

The chart seems to work correctly without the custom axis directive:

https://stackblitz.com/edit/kendo-chart-refresh-error-hzrdpc?file=app/app.component.ts

At first look, the problem occurs because the code measures the size before the element is visible after the content is shown again:

public __buildAxisConfiguration(timeRangeChanged: boolean = false): void {
    const width = this.getCanvasWidth();
    if (!!this.timeRange && width && (this.cachedWidth !== width || timeRangeChanged)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants