angularangular-materialngx-charts

Simple Ngx-Charts leaving too much gap on both sides of X-axis


I have an ngx-material vertical stacked chart and my data is very simple, yet i find that for slightly larger data sets, a large gaps shows up on both sides of the x-axis labels.

Any idea what I am doing wrong?

Here is a visual:

enter image description here

And here is a stackblitz with my simple example:

https://stackblitz.com/edit/swimlane-stacked-vertical-bar-chart-hvkbtb?file=app%2Fdata.ts


Solution

  • You are not doing anything wrong.

    It's a scaling problem when you have a lot of ticks on the X-axis. You can see the difference if you will change the view size from 700x500 to 1000x500.

    view1000x500

    Similar request was already made and it has open status: github.com/swimlane/ngx-charts/issues/1472