Я новичок в ngx-чартах. я пытаюсь показать ngx-график-линию, которую я пытаюсь показать в моей оси xAxis - время (формат - чч: мм). но я хочу показать только 4 опции на моем xAxis, например: 10:00 12:00 16:00 19:00 Я попытался исправить это с помощью l oop, а также с помощью xAxisTickFormatting. а в моем yAxis - значение вот мой компонент кода ts
this.chartData = [
{
name: "exAngular",
series: [
{ value: "252.30", name: "19:20:00" },
{ value: "252.40", name: "19:20:00" },
{ value: "252.40", name: "16:20:00" },
{ value: "252.60", name: "15:20:00" },
{ value: "252.70", name: "13:19:00" },
{ value: "252.70", name: "13:19:00" },
{ value: "252.60", name: "12:19:00" },
{ value: "252.50", name: "12:19:00" },
{ value: "252.50", name: "12:19:00" },
{ value: "252.10", name: "12:17:00" },
{ value: "252.60", name: "11:16:00" },
{ value: "230.40", name: "11:16:00" },
{ value: "230.00", name: "11:16:00" },
{ value: "230.20", name: "11:16:00" },
{ value: "252.60", name: "11:14:00" },
{ value: "252.30", name: "11:14:00" },
{ value: "252.30", name: "11:14:00" },
{ value: "252.30", name: "11:14:00" },
{ value: "252.80", name: "11:14:00" },
{ value: "252.80", name: "09:58:00" },
{ value: "252.70", name: "09:58:00" },
{ value: "252.70", name: "09:58:00" },
{ value: "252.70", name: "09:58:00" },
{ value: "251.70", name: "09:55:00" },
{ value: "251.70", name: "09:55:00" },
{ value: "251.80", name: "09:55:00" },
{ value: "251.80", name: "09:55:00" },
{ value: "251.80", name: "09:53:00" },
{ value: "251.80", name: "09:52:00" },
{ value: "252.00", name: "09:52:00" },
{ value: "251.80", name: "09:52:00" },
{ value: "252.00", name: "09:51:00" },
{ value: "252.00", name: "09:49:00" },
{ value: "252.00", name: "09:49:00" },
{ value: "252.00", name: "09:49:00" },
{ value: "252.10", name: "09:49:00" },
{ value: "251.10", name: "09:47:00" },
{ value: "251.10", name: "09:47:00" },
{ value: "251.50", name: "09:46:00" }
]
}
];`
вот мой компонент html:
<div>
<ngx-charts-line-chart [results]="chartData"
[scheme]="{domain: ['#000']}"
[xAxis]="true"
[yAxis]="true"
</ngx-charts-line-chart>
</div>