您需要使用 set 方法但嵌套选项。例如
Options options = Options.create() //Main option
Options Haxis = Options.create();
Options Hgrid = Options.create();
Hgrid.set("count", 12d);
Haxis.set("gridlines", Hgrid);
options.set("hAxis", Haxis);
Options series_options = Options.create();
Options series1_options = Options.create();
series1_options.set("color","#CE5C0A");
Options series2_options = Options.create();
series2_options.set("color","blue");
Options series3_options = Options.create();
series3_options.set("color","#6600CC");
Options series4_options = Options.create();
series4_options.set("color","#00FF00");
series_options.set("0",series1_options);
series_options.set("1",series2_options);
series_options.set("2",series3_options);
series_options.set("3",series4_options);
options.set("series",series_options);
第一个块我嵌套了将 hAxis.gridlines.count 参数设置为 12 的选项。
第二块我嵌套了很多选项来设置系列的颜色。