I am new into using ng2-charts and i wanted to know is it possible to have a horizontal bar graph? I only see a vertical bar graph but i am not sure if that could be altered to include horizontal bar graph. How far can i customize a bar graph in ng2-charts?
ng2-charts gives you a baseChart directive that can be applied on an HTML canvas element. Open app.component.html in a code editor and replace the content with the following lines of code: src/app/app.component.html.
For anyone who was wondering about the same thing - i looked into the documentation for chart.js
and was able to find just changing the bar chart type to horizontalBar works nicely. public barChartType: string = 'horizontalBar';
Bar charts can be used by adjusting the "chartType" option within your baseChart canvas.
<canvas baseChart
[datasets]="data"
[labels]="label"
chartType="horizontalBar">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With