swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

X-axis label width not calculated with chart width #1505

Open ypkkhatri opened 4 years ago

ypkkhatri commented 4 years ago

Hey,

Labels comes out chart width, as labels width are included with calculation chart width

I have provided view values ([624, 350]) which are reflected to nested chart svg tag like below:

<svg class="ngx-charts ng-tns-c223-7" width="624" height="350">...</svg>

But labels are in <g> tag and they are overflow.

Screenshot: image

Please let me know if there is any solution.

Regards,

kallebjork commented 3 years ago

Possible partial solution would be to rotate the ticks if the first or last is overflowing and rotateXAxisTicks is enabled. Here is a stackblitz of the issue: https://stackblitz.com/edit/angular-ngx-line-charts-overflow.