預發行版:2024-07-17
runSql("SELECT Name, Population FROM world.country LIMIT 10;", function (result) {
var options = {
series: [
{
id: "myFirstGraph",
type: "bar",
yLabel: "Country Population",
data: result,
marginLeft: 60,
marginBottom: 30,
yDomain: [0, 50000000]
},
],
};
Graph.render(options);
});
注意
先前的程式碼片段包含一些可能會發出資訊類型錯誤的 TypeScript 選項。TypeScript 和 JavaScript 共用相同的引擎。您可以忽略此錯誤,或切換至 TypeScript 模式並執行類似的程式碼範例 (請參閱第 9.4 節,「資料庫筆記本:以視覺圖表格式顯示資料」)。