Skip to content

Wrong line chart height when [timeline]="true" but ordinal data #2062

@PitouGames

Description

@PitouGames

Describe the bug

I had to troubleshoot why my charts had a big gap under it.

The reason is that I enabled the timeline display, but my data scaleType was 'ordinal'. The timeline doesn't display, but the gap calculation is done as if it was displayed.

The condition to display the timeline is not the same as to compute the height:


Replacing Line 305 with if (this.timeline && this.scaleType != ScaleType.Ordinal) { should do the job.

Screenshots

KO version (ordinal data on X axis);
Image

OK version (timeline is true and the gap is well computed):
Image

ngx-charts version
22.0.0 and 23.0.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions