首先 - 我只使用java脚本和Google Apps脚本大约一周。 我正试图自动完成学生完成的相当多的Google表格的标记。 我的计划是要有一个标准的谷歌表格,标记标记和奖励标记如下。 这是表2,从原材谷歌脚本图表访问属性
Question Criteria Cell reference Correct answer Marks
Question 1 FontWeight A1 bold 1
Question 2 FontFamily A1 Times New Roman 2
Question 3 FontSize A1 16 2
Question 4 Value A1 Tables and Graphs by Fred Nerk 1
Question 5 Heading Sheet Heading Tables and Graphs by Fred Nerk 1
Question 6 ChartTitle Chart Title Commonwealth Medal Tally 2014 2
Question 7 ChartType Chart Type AREA 1
Question 8 Value A3 Rank 1
Question 9 Value B3 Country 1
Question 10 Number A4 1 1
etc
我对查找代码如下: 我这些变量发送到模块: Mysht是原材2 Studsheet是学生的电子表格 Studsht1是学生答卷 标准为每桌从以上表上方从表 correctAns 参考上述 我已经能够做一些图表工作 我然后与正确答案的过程学生回答,并给马克在一份报告等
function LookupCriteria(mysht2,Studsht1,reference,Criteria,correctAns,Studsheet){
switch(Criteria) {
case "FontSize":
testvalue = Studsht1.getRange(reference).getFontSize()
break;
case "FontFamily":
testvalue = Studsht1.getRange(reference).getFontFamily();
break;
case "FontWeight":
testvalue = Studsht1.getRange(reference).getFontWeight();
break;
case "Value":
testvalue = Studsht1.getRange(reference).getValue();
var lenanswer=correctAns.length;
testvalue=testvalue.substring(0,lenanswer);
break;
case "Heading":
testvalue = StudSheet.getName();
var lenanswer=correctAns.length;
testvalue=testvalue.substring(0,lenanswer);
break;
case "ChartTitle":
var StudChart=Studsht1.getCharts()[0];
var option = "title"
testvalue=StudChart.getOptions().get(option);
break;
case "ChartType":
var StudChart=Studsht1.getCharts()[0];
testvalue=Charts.ChartType;
break;
case "Number":
testvalue=Studsht1.getRange(reference).getValue();
return testvalue;
// testvalue is the student answer
}
我的问题是: 我无法找到文件或代码访问从图表 实例信息如何“获取”的颜色为列“或横轴中使用的字体? 所有文档都是关于建筑图表的。 Cheers Col Taylor PS我知道这段代码不是最佳实践。最好使用数组和加载所有数据等 我真的只需要知道这个请求是否可能? 由于 干杯山口泰勒
什么是您所指的“图表示例”?它是否在Apps脚本帮助参考中?你有链接吗? –
非常感谢您的回答。很抱歉,在图表之后没有完整的缺失我想访问有关图表的信息。例如,一列的颜色是什么。横轴上使用的字体是什么。我不想改变这些。我想将它们与学生应该做的事情进行比较,并根据表格给予适当的评分。 Cheers Col –