I am using bootstrap for it's great grid system. I have a page with 2 div's each set to col-xl-6 which means on desktop systems each div is next to each other (Kind of float left / float right idea).
The charts being generated for some reason float on the left with means that the chart is on the left and not in the right container. Can this be fixed?
Please provide a stackblitz where this problem can be seen and reproduced.
I have put an example online:
https://stackblitz.com/edit/angular-txsrla
As you can see the legends don't align either. Each graph should have it's own container so that these kind of alignment errors don't occure.
I think you guys really need to go back to the drawing board. I am now using a advanced pie chart and if I don't set the view, because I want the pie chart to be as wide as the container, then the pie chart looks really messed up. Also reload of the pie chart is impossible. I update the values in the pie chart after a observable call and nothing happens.
Ok, a few things:
view input on the chart. If you want your chart to be as wide as the container, you need to leave that input undefined.results input of the chart is immutable. You need to pass a new array in order for the chart to be updated, not modify the old one.Here's a stackblitz with loaded bootstrap and a properly configured chart: https://stackblitz.com/edit/angular-mqcn7n?file=app/table/table.component.ts
Oke, thanks for your feedback and your time.
I have some feedback about the view. If you remove the [view]="view" line you will see what I mean.
Also I have now added the bootstrap cdn and now bootstrap is working. The pie chart still isn't aligning to the right.
@martijnhiemstra
You are using bootstrap 4 which uses col-* notation for the smallest breakpoint but you never defined that breakpoint.
your containing div should also either be a bootstrap row or d-flex
I have successfully used ngx-charts with bootstrap 4 in my application.
Here's an example of the lib not working with bootstrap cards: https://stackblitz.com/edit/angular-1t2oom
essentially any parent element that is a flex box doesnt seem to work. Looks related to https://github.com/swimlane/ngx-charts/issues/1248
Most helpful comment
Ok, a few things:
viewinput on the chart. If you want your chart to be as wide as the container, you need to leave that input undefined.resultsinput of the chart is immutable. You need to pass a new array in order for the chart to be updated, not modify the old one.Here's a stackblitz with loaded bootstrap and a properly configured chart: https://stackblitz.com/edit/angular-mqcn7n?file=app/table/table.component.ts