Timeline chart with Angular 11. Options don't work

119 views
Skip to first unread message

Ana Lúcia Lodi da Cruz

unread,
Sep 23, 2021, 1:07:06 PM9/23/21
to Google Visualization API

Hi all,

I'm using Angular 11 to create a timeline chart . The problem is that many options contained in the documentation are ignored. I can generate the chart, but I can't customize almost anything on the horizontal axis, for example. See code bellow. 
I found several instructions in many forums, such as using "convertOptions" (google.charts.Bar.convertOptions(options), but I get the error "google is not defined".  All the solutions I've seen don't seem to apply to Angular 2+.

Any suggestion?

Thanks,

Ana

options = {
timeline: {
rowLabelStyle: {fontName: 'Helvetica', fontSize: 18, color: '#603913' },
barLabelStyle: { fontName: 'Garamond', fontSize: 14 },
},
theme: 'material',
hAxis: {
title: 'teste',
format: 'dd/MM',

// All options bellow are ignored:  <======
gridlines: {
count: 10,
},
minValue: new Date(2021, 8, 7),
maxValue: new Date(2021, 8, 10),
textPosition : "out",
slantedText:true,
slantedTextAngle:45,
legend: { position: 'top', maxLines: 3 },
},
};
Reply all
Reply to author
Forward
0 new messages