0

我正在使用 Angular 11 创建时间线图。问题是文档中包含的许多选项都被忽略了。例如,我可以生成图表,但我几乎无法自定义水平轴上的任何内容。请参见下面的代码。我在许多论坛中找到了一些说明,例如使用“convertOptions”(google.charts.Bar.convertOptions(options),但我收到错误“google is not defined”。我见过的所有解决方案似乎都没有适用于 Angular 2+。

有什么建议吗?

谢谢,

安娜

    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 }, 
    },
  };

4

0 回答 0