Skip to content

Commit

Permalink
-Multiline x axis labels.
Browse files Browse the repository at this point in the history
- Remove axis borders.
  • Loading branch information
kalpshekhar-sag committed Jan 20, 2022
1 parent 0c0fd52 commit 979e82d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/c8y-barchart-widget/c8y-barchart-widget.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ export class C8yBarchartWidget implements OnDestroy, OnInit {

// Add labels to the array
this.chart.data.labels = this.configDatapoints.map((dp) => {
return dp.label;
// Create sub-array by splitting by space to enable multi-line label.
return dp.label.split(" ");
});

// Add points to the array
Expand Down Expand Up @@ -177,10 +178,16 @@ export class C8yBarchartWidget implements OnDestroy, OnInit {
maintainAspectRatio: false,
scales: {
xAxes: [{
display: true
display: true,
gridLines: {
display: false,
}
}],
yAxes: [{
display: false,
gridLines: {
display: false,
},
ticks: {
beginAtZero: true
}
Expand Down

0 comments on commit 979e82d

Please sign in to comment.