8

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?

bluePearl
  • 1,237
  • 4
  • 24
  • 42

2 Answers2

12

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';

bluePearl
  • 1,237
  • 4
  • 24
  • 42
7

Bar charts can be used by adjusting the "chartType" option within your baseChart canvas.

<canvas baseChart
        [datasets]="data"
        [labels]="label"
        chartType="horizontalBar">

Sabin Bogati
  • 721
  • 8
  • 11