-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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:
ngx-charts/projects/swimlane/ngx-charts/src/lib/line-chart/line-chart.component.ts
Line 156 in ea9f704
| *ngIf="timeline && scaleType != 'ordinal'" |
ngx-charts/projects/swimlane/ngx-charts/src/lib/line-chart/line-chart.component.ts
Line 305 in ea9f704
| if (this.timeline) { |
Replacing Line 305 with if (this.timeline && this.scaleType != ScaleType.Ordinal) { should do the job.
Screenshots
KO version (ordinal data on X axis);

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

ngx-charts version
22.0.0 and 23.0.1