I use config for creating chart. But if I write gridIntervals in config it's not working. If I set gridIntervals manually it works.
config doesn't work
xAxes: [
{
type: 'DateAxis',
renderer: {
labels: {
template: {
location: 0.5,
fill: '#666666',
fontSize: 12,
},
},
grid: {
template: {
strokeWidth: 0,
},
},
axisFills: {
template: {
fillOpacity: 0,
disabled: false
},
},
},
fillRule: (dataItem: DateAxisDataItem) =>
(dataItem.axisFill.visible = true),
gridIntervals: [
{
timeUnit: 'hour',
count: 1,
},
],
periodChangeDateFormats: {
hour: 'HH:mm',
},
},
],
creating chart
this.chart = am4core.createFromConfig(config, this.chartContainerEl.nativeElement);
this is work
this.chart.xAxes.values[0].gridIntervals.setAll([
{ timeUnit: "hour", count: 1 }
])
What I do wrong?