I am developping un app with some line chart. I use line Chart within "ngx-chart" library . It works, but I would like to have a better display of axis. My data are temperatures values according to date. Actually, the chart display a label for each value. If i have 100 values, I have 100 ticks labels. So i vould like to limit the number of ticks.
I use Angular and NGX chart. I saw in the docs the parameter "xAxisTicks" but it seems it is not the good way
component.html:
<ngx-charts-line-chart
[legendTitle]="legendTitle"
[xAxisTickFormatting]="xAxisTickFormatting"
[view]=""
[scheme]="colorScheme"
[results]="temperatures"
[gradient]="gradient"
[xAxis]="showXAxis"
[yAxis]="showYAxis"
[legend]="showLegend"
[showXAxisLabel]="showXAxisLabel"
[showYAxisLabel]="showYAxisLabel"
[xAxisLabel]="xAxisLabel"
[yAxisLabel]="yAxisLabel"
[autoScale]="autoScale"
(select)="onSelect($event)">
</ngx-charts-line-chart>
component.ts
legendTitle = "Température actuelle";
showXAxis = true;
showYAxis = true;
gradient = false;
showLegend = true;
showXAxisLabel = true;
xAxisLabel = 'Heure';
showYAxisLabel = true;
yAxisLabel = 'Température';
// xAxisTicks = [
// new Date("2019-10-06 10:00:00"),
// new Date("2019-10-06 10:30:00"),
// new Date("2019-10-06 11:00:00"),
// new Date("2019-10-06 11:30:00"),
// new Date("2019-10-06 12:00:00"),
// ]
colorScheme = {domain: ['#5AA454', '#A10A28', '#C7B42C', '#AAAAAA'] };
autoScale = true;
data :
multi = [
{
"name": "Exterieur",
"series": [
{
"name": new Date("2019-10-09 10:00:00"),
"value": 15
},
{
"name": new Date("2019-10-11 10:10:00"),
"value": 17
}
]
}]
Actual result :
I would like to have this :
Fewer labels but keeping all the data.
Is it possible with ngx chart ?
Thanks you Thomas