I have a problem with primeNg chart using angular 2. I am able to display the chart using the following code in my component:
fillChartData(data){
this.chartData = {
labels: data.map( x => x.nameProcess ),
datasets: [
{
label: 'error',
data: data.map( x => x.nbError ),
backgroundColor: 'rgba(100,149,237,0.5)',
}],
options: {
animation:{
animateScale:true
}
}
};
setTimeout(() => this.chart.reinit()); //TODO
}
The code of my html:
<div class="col-lg-8 col-md-6">
<div class="card" >
<div class="card-content" id="barC">
<h4 class="title title-centered" >{{title}}</h4>
<p-chart #chart2 type="bar" [data]="chartData" (click)="chartClicked($event)"></p-chart>
</div>
</div>
</div>
And the chart I got on browser: enter image description here
But now I want to display the x-labels horizontally and not as they showed up. Is there any way to rotate the x-label in order to display them horizontally? I look closely in primeNgCharts and chart.js documentations but I'm not able to find something who actually give me wanted behaviour.
nbError- AravindnbErroris anumber. The final json look like{[nameProcess: string, nbError: number]}- Géraud Willing B-S