functiondoGet(){vardata=Charts.newDataTable().addColumn(Charts.ColumnType.STRING,'Month').addColumn(Charts.ColumnType.NUMBER,'In Store').addColumn(Charts.ColumnType.NUMBER,'Online').addRow(['January',10,1]).addRow(['February',12,1]).addRow(['March',20,2]).addRow(['April',25,3]).addRow(['May',30,4]).build();varchart=Charts.newAreaChart().setDataTable(data).setStacked().setRange(0,40).setTitle('Sales per Month').build();varhtmlOutput=HtmlService.createHtmlOutput().setTitle('My Chart');varimageData=Utilities.base64Encode(chart.getAs('image/png').getBytes());varimageUrl="data:image/png;base64,"+encodeURI(imageData);htmlOutput.append("Render chart server side: ");htmlOutput.append("\"1\" src=\""+imageUrl+"\">");returnhtmlOutput;}
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-12-06。"],[[["The Google Apps Script Charts Service enables server-side rendering of charts using Google Charts Tools, offering an alternative to the client-side Google Charts API."],["Charts are built using a structured process involving data table creation, chart construction with specific configurations like type, data source, and styling, and HTML output generation for display."],["The Charts Service provides a range of chart types, including AreaChart, BarChart, ColumnChart, LineChart, PieChart, ScatterChart, and TableChart, each with corresponding builder classes for customization."],["Comprehensive documentation details various classes and methods for data manipulation, visual styling, axes configuration, and interactive element creation, empowering developers to tailor charts to their needs."],["Developers can leverage methods from ScatterChartBuilder, StringFilterBuilder, TableChartBuilder, TextStyle, and TextStyleBuilder to fine-tune chart axes, filtering, table layouts, and text styles, enhancing chart customization and functionality."]]],["This service renders server-side charts using Google Charts Tools. Users create charts through builders like `AreaChartBuilder`, `BarChartBuilder`, etc. Data is structured in `DataTable` objects via `DataTableBuilder`. Charts can be converted to static images using `Chart.getAs()`. Customization includes setting colors, titles, dimensions, legends, axis styles, and data ranges. `ChartOptions` allow for advanced configurations. The `Charts` class provides the creation entry point and enums define chart, data, and styling options.\n"]]